Тема: Making a Ajax request and manipulate the text
Hi,
I'm looking for a way to make a page request in Ajax and retrieve the request page to a string. This string should be available to any function but in the example below it isn't because alert(data); doesn't popup. After converting to a string i want to manipulate the text by using "find" to look for a string or a text in a determined area. Can this be done?
[code=HTML]
<input type="text" id="http" value="http://www.example.com">
<br>
<input type="button" id="submit" onclick="myhttp()" value="Send!"/>
<script>
function myhttp() {
var http = document.getElementById("http").value;
var dataString = 'lsd=AVrls4dL&email=email@gmail.com';
$.ajax({
type: "GET",
url: http,
data: dataString,
async: false,
success: function(data){
alert(data);
}
});
}
</script>
[/code]
Thanks