开发者

jquery GET adds current url to my url parameter

开发者 https://www.devze.com 2023-04-11 15:12 出处:网络
I have a GET request in a document. The current page I am on includes that document and then the document is executed. The issue is the document is found when included but the GET request is not becau

I have a GET request in a document. The current page I am on includes that document and then the document is executed. The issue is the document is found when included but the GET request is not because the request that is being sent by GET (according to firebug) is http://www.site.com/watch/http//www.site.com/file/doc.php when the request should just be requested by GET to http//www.site.com/file/doc.php. The current page I am on is http://www.site.com/watch/123456 where watch is an alias for video.php?vid_id=. Anyone have any ideas as to why this is happening?

         $.getJSON("http//www.site.com/file/doc.php?action=view&load=initial&page="+page+"&vid_id="+vid_id+"&username="+username+"&t=" + (new Date()), function(json) {  
  var html = '';
  for(i=0; i < json.length; i++) {
    html += prepare(jso开发者_如何学编程n[i]);
  }
  $('#shoutbox-list').append(html).find('li').fadeIn(1500);
   $('div[id="chunk"]').fadeIn(1500);
});


You just need to insert a colon into your URL so that it's a valid resource identifier:

e.g. change:

$.getJSON("http//www.site.com/....

to

$.getJSON("http://www.site.com/....
               ^
0

精彩评论

暂无评论...
验证码 换一张
取 消