You can't make HTTP requests with _javascript_.  However, you can use a hidden
frame to do the dirty work.  Create a hidden frame, set it's location to
your URL, then check the content of it's document to get the output from the
url (what you need) and set it to your variable. Just be careful, because
setting the location is an asyncronous operation, so it'll return
immediately.  You'll have to use setTimout or setInterval to keep checking
the hidden frame's document source to see when the request is finished
processing.

Cheers,
barneyb

> -----Original Message-----
> From: Nikhil Madani [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 12, 2004 12:36 PM
> To: CF-Talk
> Subject: Re: _javascript_: Retrieving Remote HTML
>
> That's definitely possible, but I surely cannot do an <script
> src="" from within a _javascript_ function....is there
> a way I could assign the js variable (created on page B)to a
> global scope that I can then
> access inside any _javascript_ function on page A?
>
> > One method would be to include Page B with a _javascript_ include
> > (<script src="" and have Page B put the string you're
> > after into a _javascript_ variable.  After the include, your code can
> > see that variable as if it were on the same page.
>  
> >
> > I'm sure there's more elegant solutions though.
>  
> >
> > Shawn
> >
> > -----Original Message-----
> > From: Nikhil Madani [mailto:[EMAIL PROTECTED]
> > Sent: Friday, March 12, 2004 1:20 PM
> > To: CF-Talk
> > Subject: _javascript_: Retrieving Remote HTML
> >
> >
> > I know this forum might not be the most relevant place for
> _javascript_
> > help, but anyway here is my problem:
> >
> > On a certain page A, I have a _javascript_ function that needs to
> > retrieve
> > HTML code from another web page B, possibly on another
> server.I know
> > for a fact that the page I'm trying to reach will output a single
> > string and I need to set a _javascript_ variable with that value.
> >
> > (For those curious, this other page is a cfm page where I create a
> > string
> > value based on the url params)
> >
> > Any ideas?
> >
> > TIA
> > Nik
>   
> > _____  
> >
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to