I have a itunes link for a song, when the user clicks the link I want first to record this in a database and then redirect him to itunes so I used AJAX, the link is
-
<a name='1<?php echo $aa; ?>' href='#1<?php echo $aa;?>' onClick="rec_song(<?php $skwd=$songs_array[$aa]['code']; echo "'$skwd'";?>,<?php echo "'$kwd'";?>)">
-
In the same file I include a js file which calls a php file to make the record in the database and then uses
-
function stateChanged()
-
{
-
if (xmlHttp.readyState==4)
-
{
-
var itunesurl=xmlHttp.responseText;
-
window.location=itunesurl;
-
-
}
-
}
-
I retrieve the url for the particular album from my php file and echo it then I use the above function to redirect him. Works fine in all browsers except safariwhere if the link is e.g.
http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=272152906&s=14344
it makes it
/generalm/demo/http://phobos.apple.com/WebObjects/MZStore.woa/wa/view
and says not found (all the files are in a directory /generalm/demo/)
any ideas?