Passing variable from PHP to JS file works in Firefox and Chrome but not Internet Explorer
Here is a snippet of my php...
- <script type="application/javascript">
- <?php echo "var dataString='albumid=".$_GET['albumid']."';\n"; ?>
- </script>
- <script src="js/simplethumbgallery.js" type="text/javascript"></script>
As you can see I am using the PHP to set a javascript variable. Firefox and Chrome have no problem with this. IE however errors out inside simplethumbgallery.js and says that dataString is undefined.
For further clarification I have attached the beginning of the code in the js file that is trying to use dataString
- $(document).ready(function(){
- //hover thumb in albumlist
- $("albumlistbody a").fadeTo("fast", 0.65);
- //load album in the background
- $.ajax({
- type: "POST",
- url: "../content/album_load.php",
- data: dataString,
- success: function(html){
- $("#gallery").html( html );
Not that this helps but here is the IE error just in case...