JavaScript的 - 如何执行一个简单的GET的WebRequest?简单、JavaScript、WebRequest、GET

由网友(炫酷的腿毛)分享简介:我怎样才能在javascript执行一个简单的WebRequest。如VAR海峡= * whatever_comes_back_from *(?search.php中术语=你好);解决方案 您可以使用jQuery或其他JavaScript的,而不是填充变量然后以线性的方式脚本在继续的思想库,但是,你应该考虑的方面回调一...

我怎样才能在javascript执行一个简单的WebRequest。

  VAR海峡= * whatever_comes_back_from *(?search.php中术语=你好);
 

解决方案

您可以使用jQuery或其他JavaScript的,而不是填充变量然后以线性的方式脚本在继续的思想库,但是,你应该考虑的方面回调一次的值的被检索,因为它可以利用时间来检索数据量可变。

架构此事件的JavaScript的功能,是罕见的在其他编程语言。

  $。获得('的search.php?长期=你好',功能(数据){
    警报(数据)
});
 
简单方便的 JavaScript 逆向辅助模拟方法

How can I execute a simple webrequest in javascript.

Such as

var str = *whatever_comes_back_from*("search.php?term=hello");

解决方案

You could use jQuery, or another javascript library, but instead of thinking of populating the variable then continueing with the script in a linear way, you should think in terms of a callback once the value is retrieved, because it can take a variable amount of time to retrieve the data.

This event based architecture is a feature of javascript that is rare in other programming languages.

$.get('search.php?term=hello', function(data){
    alert(data)
});

阅读全文

相关推荐

最新文章