Get file contents in java script

前端 未结 2 1590
逝去的感伤
逝去的感伤 2020-12-14 10:58

I\'ve a URL that its contents are also JavaScript codes, I want to get the contents of this URL via JavaScript something like to file_get_contents() in PHP and

2条回答
  •  萌比男神i
    2020-12-14 11:58

    You can use XMLHttpRequest in Javascript to fetch datas from an external URL. Here is a good resource : http://www.w3schools.com/ajax/default.asp (I usually don't recommend them, but the AJAX tutorial is really good).

    Also, this had to be there :

    jQuery ownz

提交回复
热议问题