0

I'm having a jquery mobile page with JavaScript inside. the problem is the JavaScript doesn't work unless the page is refreshed. here is my code:

<script language="javascript" type="text/javascript">
    var url = window.location.search.substring(1);

    jQuery(function($){
        $('#mydiv').load('real_news.asp?'+url);
    });
</script>
Gajotres
  • 57,311
  • 16
  • 100
  • 128
user2522201
  • 75
  • 1
  • 3
  • 12

1 Answers1

0

Put the URL inside jQuery:

jQuery(function($){
  var url = window.location.search.substring(1);

  $('#mydiv').load('real_news.asp?'+url);
});
Ankit Zalani
  • 3,018
  • 5
  • 25
  • 46