This code fetches the HTML source of http://www.foo-example-site.com/(index.html)
$.ajax({ url: 'http://www.foo-example-site.com', success: function(data) {
alert(data);
}
});
However, the website changes the content of HTML source depending on User Agent.
If I want to switch User Agent to this below only when using ajax request, how can I fix my code?
Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16