0

As we all know HttpwebRequest loads another page behind the scenes without redirecting the client to the other page.

How can I get this functionality using Javascript/Jquery?

$(document).ready(function () {
debugger;
var ip = '<%= Request.UserHostAddress%>';
var location = window.location.href;
var Browser = BrowserDetect.browser;
var Version = BrowserDetect.version;
var Os = BrowserDetect.OS;
var SendItems = 'Ip=' + ip + '&location=' + location + '&Browser=' + Browser   + '&Version=' + Version + '&Os=' + Os;
var HttpWebReq = ?

I want to pass these values as a query string to the other page :S

0

2 Answers 2

1

A cross domain example by using yql,

var url = 'xyz.com'; // website you want to scrape
var yql = 'http://query.yahooapis.com/v1/public/yql?q=' + encodeURIComponent('select * from html where url="' + url + '"') + '&format=json&callback=?';  
$.getJSON(yql,function(data){
    if (data.results[0]){  
        console.log(data = data.results[0].replace(/<script[^>]*>[\s\S]*?<\/script>/gi, ''));  // The scraped data (the whole webpage)
    }
});
Sign up to request clarification or add additional context in comments.

Comments

0

As Corbin commented - you are looking for AJAX tutorial.

Since you've tagged with JQuery starting from JQuery.ajax is a good idea.

Also check out other related questions like - How to get page content using Javascript or JQuery

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.