Closed Thread Icon

Topic awaiting preservation: Client Side programming server side requests with javascript (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=25798" title="Pages that link to Topic awaiting preservation: Client Side programming server side requests with javascript (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Client Side programming server side requests with javascript <span class="small">(Page 1 of 1)</span>\

 
Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 05-18-2005 06:17

I'm looking for a starting point; would like to create javascript code which calls serverside script. I would like to avoid creating anything activex do to hightened security with browsers these days. Any ideas? How does google pull off their adsense scripts? Something like that might work.

Karl..

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 05-18-2005 06:23

XMLHTTPRequest

Note it's activeX for IE but integrated for other browsers.



.:[ Never resist a perfect moment ]:.

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 05-18-2005 07:42

or "good old" remote scripting like in 2000.

Iron Wallaby
Paranoid (IV) Inmate

From: USA
Insane since: May 2004

posted posted 05-18-2005 07:48

If that was ever called good, I think the purist modulator in my brain exploded.

---
Website

Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 05-18-2005 07:52

Errr... I was hoping for something along the lines of a javascript src = "<server_side_script"... but once the browser is loaded (I can see how that works one teim) but how to invoke it again / reload the javascript on user click?
What about tacking on additional HTML to the end of the clients result... after the closign </html> tag?

Any ideas on this? (sorry, activex no good... and how do you wire up remote scripting again?)

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 05-18-2005 08:07




If you want you can create some SCRIPT objects with the DOM and set the src attribute to load anything at any time. But that's just another way to do remote scripting ( the other one being to use a hidden iframe or frame to load a page that will then update the main page ).

The thing you load ( either a full page or just a JS ) is dynamic and usually needs to retrieve some paramaters sent in GET by the main page to do its job on server side and output the thing requested ( either a full page or just a JS ).



(Edited by poi on 05-18-2005 08:19)

Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 05-18-2005 09:35

I get the "get" stuff...

>If you want you can create some SCRIPT objects with the DOM and set the src attribute to load anything at any time

How do I make that fly? Ahhh : ) I'll follow your link! If you have a down and dirty example, please throw it in!

Thanks, Karl..

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 05-18-2005 09:46

I found an menu I did a while ago that uses remote scripting and generates some SCRIPT tags to load the new contents.

That's tree menu powered by XHTML + CSS + JAVASCRIPT + PHP + XML + XSL pfff! I should rewrite it an shorten that mess by AJAX

Check the last few lines of the JS script.

[edit] Check also this link on Using the XML HTTP Request object [/edit]




(Edited by poi on 05-18-2005 09:59)

Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 05-18-2005 22:25

That is very cool, will check that out this evening!

[From your link: Using the XML HTTP Request object]
..These methods are increasingly used to provide richer Web Applications like G-Mail that use lower bandwidth and offer snappier user response.

Does Gmail rely on XMLHTTP? I figured they employed a different technology.

Karl

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 05-19-2005 01:39

Gmail is one of the applications that made the xmlHttpRequest object famous. There is also Google Map, Google Suggest, ...
You heard about AJAX do you ?

Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 05-19-2005 04:02

Stumbled upon AJAX the other night. Is it: using a frame as sort of a middle-tier to the client app?
How is it that Gmail can get away with instantiating the active x component, none of my browsers have ever complained?

Iron Wallaby
Paranoid (IV) Inmate

From: USA
Insane since: May 2004

posted posted 05-19-2005 04:22

No, it has no need to use frames. XMLHttpRequest makes an HTTP query directly, no need to load things into frames or anything.

The reason why Gmail can use ActiveX (in MSIE, at least -- everyone else handles it natively) is because it respects domain -- XMLHttpRequest violates no security restrictions when it queries from the same domain and port the parent page is in. For example, if I have a website at http://www.rpi.edu/~laporj2/index.html:80 (which I do ), I can make HTTP queries to anything at http://www.rpi.edu/, and at port 80. However, if I tried to query something from http://www.google.com/, it would create a security violation and would either fail or alert the user.

---
Website

Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 05-19-2005 05:51

This is very interesting! How does the client machine know that the component is accessing the same domain? And.. I always thought the security alarm would go off not when attempting to send the request, but upon creation of the active x object???

Iron Wallaby
Paranoid (IV) Inmate

From: USA
Insane since: May 2004

posted posted 05-19-2005 05:58

Oh, I think you mean the "security" built in to Internet Explorer for Active X objects? That's gotten around quite easily by digitally signing the script, I believe. Internet Explorer trusts signed scripts, for whatever stupid reason.

For the client machine, it's quite easy to check whether your request is from the same domain, since it knows what domain you're in (window.location) and what domain you're requesting (in the XMLHttpRequest object), so it's a simple matter to compare two strings.

The server, however, does not know or care that you're using an XMLHttpRequest from domain x. All it knows is that someone wants index.html, so it will feed you back index.html.

---
Website

Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 05-19-2005 07:13

I'm on it! Going to develop an "Athlete" lookup for my site. I have all ready created some indexes to support the effort and am excited to embark on this new technology!

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 05-19-2005 07:36

blarg. 14 responses to get back to the first one given.

I also stand on principal of not jumping on the bandwagon and calling it Ajax.



.:[ Never resist a perfect moment ]:.

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 05-19-2005 07:38

Karl: the things you asked were explained in the 2 links bitdamaged and I gave you about the xmlHttpRequest object

ps: I just woke up ... and am not yet sure with which foot.

Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 05-19-2005 08:01

Thanks poi,
Just thinking outloud here. I am all over these links! Wanted to get my head straight before I embarked. So far, I have the xmlhttp object created, calls my asp "mso_lookups.asp" webservice, which does nothing more than return an <response><a>this is cool</a></response>.
Next I have to tie in client side transformations..

Karl

Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 05-19-2005 08:03
quote:
bitdamaged said:

I also stand on principal of not jumping on the bandwagon and calling it Ajax.



Please explain.

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 05-19-2005 08:09

Ajax is the name a f**king detergent. It must be the most stupid name for a technical approach. And everybody says Ajax here, Ajax there, it's just not fun.

amikael
Bipolar (III) Inmate

From: övik
Insane since: Dec 2002

posted posted 05-19-2005 12:57
quote:
Karl said:

This is very interesting! How does the client machine know that the component is accessing the same domain? And.. I always thought the security alarm would go off not when attempting to send the request, but upon creation of the active x object???



If you mean the xmlhttp-component, that's an exception.
It's not really activeX as far as Microsoft are concerned, it just happens to share that same syntax.

I know, but dont look for logic where there is none.

(^-^)b

amikael
Bipolar (III) Inmate

From: övik
Insane since: Dec 2002

posted posted 05-19-2005 12:59
quote:
Karl said:

..upon creation of the active x object???



If you mean the xmlhttp-component, that's an exception.
It's not really activeX as far as Microsoft are concerned, it just happens to share that same syntax.

I know, but dont look for logic where there is none.

(^-^)b

Iron Wallaby
Paranoid (IV) Inmate

From: USA
Insane since: May 2004

posted posted 05-19-2005 13:34
quote:
poi said:

It must be the most stupid name for a technical approach. And everybody says Ajax here, Ajax there, it's just not fun.


I think Ajax is a fun name. It's like making your code squeaky clean or something equally insane.

---
Website

Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 05-20-2005 08:07

The following script works great on localhost, but bombs on the server. The failure is: permission denied. What am I doing wrong?

Sorry, it is the link "Get Last Name" which tests the xmlhttp request.

http://www.meetscoresonline.com/test.html

(Edited by Karl on 05-20-2005 08:08)

« BackwardsOnwards »

Show Forum Drop Down Menu