"Tom Szabo" <tom@intersoft. net.au> wrote in message
news:419b3832$1 @dnews.tpgi.com .au...[color=blue]
>
> I like to know if there is a JS function to retrieve a URL into a variable
>
> cURL = somefunction("h ttp://www.domain.com" );
>
> Is there something like this?
>
> TIA,
>
> Tom[/color]
By "retrieve a URL" do you mean of the page containing the JS?
On Wed, 17 Nov 2004 12:31:43 GMT, McKirahan wrote:
[color=blue]
> "Tom Szabo" <tom@intersoft. net.au> wrote in message
> news:419b3832$1 @dnews.tpgi.com .au...[color=green]
>>
>> I like to know if there is a JS function to retrieve a URL into a variable
>>
>> cURL = somefunction("h ttp://www.domain.com" );[/color][/color]
....[color=blue]
> By "retrieve a URL" do you mean of the page containing the JS?[/color]
I suspect the OP is actually referring to retrieving the content
of another URL (than the page itself) into a JS var as text.
> >> cURL = somefunction("h ttp://www.domain.com" );[color=blue]
> ...[color=green]
> > By "retrieve a URL" do you mean of the page containing the JS?[/color]
>
> I suspect the OP is actually referring to retrieving the content
> of another URL (than the page itself) into a JS var as text.[/color]
"Michael Winter" <M.Winter@bluey onder.co.invali d> wrote in message
news:opshl090ol x13kvk@atlantis ...[color=blue]
> On Wed, 17 Nov 2004 22:34:50 +1000, Tom Szabo <tom@intersoft. net.au>[/color]
wrote:[color=blue]
>
> [snip]
>[color=green]
> > I could be using the wrong terminology, what I ment is to get the
> > content of the web page the URL pointing to....so[/color]
>
> Please read the FAQ (<URL:http://jibbering.com/faq/>). Your question is
> answered there.[/color]
Thanks for that, but I think that asi a way too complicated solution....
If there is no simpler, I can just create a new window with the URL and read
the content of the DOC if nothing better, but I do beleive thre should be a
simpler solution...?
Tom Szabo wrote:[color=blue][color=green]
>> By "retrieve a URL" do you mean of the page containing the JS?[/color]
>
> I could be using the wrong terminology, what I ment is to get the
> content of the web page the URL pointing to....so
>
> var "url" would contain something like:
>
> "<html>
> <head>
> ....
>
> .....
> /html>"
>
> Am I making sense? sorry if still not ....
>
> TIA,
>
> Tom[/color]
"Tom Szabo" <tom@intersoft. net.au> wrote in message
news:419b4cfd$1 @dnews.tpgi.com .au...[color=blue][color=green][color=darkred]
> > >> cURL = somefunction("h ttp://www.domain.com" );[/color]
> > ...[color=darkred]
> > > By "retrieve a URL" do you mean of the page containing the JS?[/color]
> >
> > I suspect the OP is actually referring to retrieving the content
> > of another URL (than the page itself) into a JS var as text.[/color]
>
> YES, correct, that is what I like to do...[/color]
Will this help? Watch for word-wrap.
Change the value of "onclick=XM L()" as necessary.
<html>
<head>
<title>XMLHTTP. htm</title>
<script type="text/vbscript">
Sub XML(strURL)
Dim strXML
strXML = strURL
Dim objXML
Set objXML = CreateObject("M icrosoft.XMLHTT P")
objXML.Open "GET", strURL, False
objXML.Send
If Err.Number = 0 And objXML.Status = 200 Then
strXML = objXML.Response Text
strXML = Replace(strXML, "<","<")
strXML = Replace(strXML, ">",">")
strXML = Replace(strXML, vbLf,"<br>")
End If
Set objXML = Nothing
document.write( strXML)
End Sub
</script>
</head>
<body>
<input type="button" value="Click Me!"
onclick="XML('h ttp://www.Google.com/')">
</body>
</html>
"McKirahan" <News@McKirahan .com> wrote in message
news:ScKmd.9876 3$HA.57358@attb i_s01...[color=blue]
> "Tom Szabo" <tom@intersoft. net.au> wrote in message
> news:419b4cfd$1 @dnews.tpgi.com .au...[color=green][color=darkred]
> > > >> cURL = somefunction("h ttp://www.domain.com" );
> > > ...
> > > > By "retrieve a URL" do you mean of the page containing the JS?
> > >
> > > I suspect the OP is actually referring to retrieving the content
> > > of another URL (than the page itself) into a JS var as text.[/color]
> >
> > YES, correct, that is what I like to do...[/color]
>
>
> Will this help? Watch for word-wrap.
>
> Change the value of "onclick=XM L()" as necessary.[/color]
JRS: In article <ScKmd.98763$HA .57358@attbi_s0 1>, dated Wed, 17 Nov
2004 15:35:14, seen in news:comp.lang. javascript, McKirahan
<News@McKirahan .com> posted :[color=blue]
>"Tom Szabo" <tom@intersoft. net.au> wrote in message
>news:419b4cfd$ 1@dnews.tpgi.co m.au...[color=green][color=darkred]
>> > >> cURL = somefunction("h ttp://www.domain.com" );
>> > ...
>> > > By "retrieve a URL" do you mean of the page containing the JS?
>> >
>> > I suspect the OP is actually referring to retrieving the content
>> > of another URL (than the page itself) into a JS var as text.[/color]
>>
>> YES, correct, that is what I like to do...[/color]
>
>
>Will this help? Watch for word-wrap.[/color]
Watching for word-wrap is the author's duty. Don't be slothful.
[color=blue]
>Change the value of "onclick=XM L()" as necessary.
>
><html>
><head>
><title>XMLHTTP .htm</title>
><script type="text/vbscript">
>Sub XML(strURL)
> Dim strXML
> strXML = strURL
> Dim objXML
> Set objXML = CreateObject("M icrosoft.XMLHTT P")
> ...[/color]
Not only is this a javascript newsgroup, but it is also substantially a
group for web pages.
Therefore, since many differing OSs and browsers can be used to read Web
pages, a "solution" that works only with Microsoft systems is of limited
use, unless the OP has indicated otherwise. When a limited-use
"solution" is presented, a corresponding warning should be given. Yours
appears to be such a "solution", even in javascript.
Comment