I don't know if it's possible but what I want is creating some script that scans into a webpage that isn't on my server and grab it's sourcecode so I could use some data, like PERL or Rails scripting but with Jquery/Javascript
Is that possible?
I don't know if it's possible but what I want is creating some script that scans into a webpage that isn't on my server and grab it's sourcecode so I could use some data, like PERL or Rails scripting but with Jquery/Javascript
Is that possible?
In the general case, no, it's not possible from the client because of the Same Origin Policy, which prevents your loading and looking at the HTML and script source of content loaded from different origins. (You can, of course, do this with JavaScript on the server — NodeJS, Rhino, and similar.)
However, if the other domains support Cross-Origin Resource Sharing and the browser you're using also supports it, that can allow the other end (the other website) to allow code from your origin (or all origins) to access it. The other end has to allow it, though.
You'll also hear about JSON-P in this context, but that only allows you to get data (not HTML source and such) from the other end, and requires that the other end explicitly support it.
So you probably have to have a server involved. It doesn't necessarily follow that it has to be your server, though: You can use YQL as a cross-domain proxy for some purposes.
No its not possible from clientside to grab HTML code from another webpages. Unless you are able to configurate the other servers.
http://en.wikipedia.org/wiki/Same_origin_policy For more reading
Same-Origin Policy
The same-origin policy is a sweeping security restriction on what web content JavaScript code can interact with. It typically comes into play when a web page includes elements or opens other browser windows. In this case, the same-origin policy governs the interactions of JavaScript code in one window or frame with the content of other windows and frames. Specifically, a script can read only the properties of windows and documents that have the same origin as the document that contains the script.
The origin of a document is defined as the protocol, host, and port of the URL from which the document was loaded. Documents loaded from different web servers have different origins. Documents loaded through different ports of the same host have dif- ferent origins. And a document loaded with the http: protocol has a different origin than one loaded with the https: protocol, even if they come from the same web server.
It is important to understand that the origin of the script itself is not relevant to the same-origin policy: what matters is the origin of the document in which the script is embedded. Suppose, for example, that a script hosted by host A is included (using the src property of a element) in a web page served by host B. The origin of that script is host B and the script has full access to the content of the document that contains it. If the script opens a new window and loads a second document from host B, the script also has full access to the content of that second document. But if the script opens a third window and loads a document from host C (or even one from host A) into it, the same-origin policy comes into effect and prevents the script from accessing this document.
author: David Flangan: Javascript; The Definite Guide
In the purest sense of your question, yes this is possible but I get the feeling you're misunderstanding how these technologies work. Even if x-domain requests were possible there is literally no way for javascript to gather data from an external source except through AJAX when being used inside a browser. The reason I say the answer is yes however is because these restrictions only apply when javascript is being executed inside a browser. If you're using javascript in conjunction with say node.js for example the rules are completely different as javascript is capable of creating sockets and the x-domain restrictions no longer apply.
Perhaps you should clarify your question so a more appropriate answer may be offered.