473,386 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

FAQ Topic - How do I run a server side script?

-----------------------------------------------------------------------
FAQ Topic - How do I run a server side script?
-----------------------------------------------------------------------

You trigger a server-side script by setting any object's URL. For
example a frame, window, or an Image. An image will also
"swallow" the data sent back by the server, so that they will
not be visible anywhere.

var dummyImage = new Image();dummyImage.src = "scriptURL.asp?param=" + varName;

Mozilla (NN6.2+, Firefox, Ice Weasle etc), Opera 7.6+, Safari1.2+, the
Windows version of IE versions 5+, and some other browsers
provide the XML HTTP Request object. This allows JavaScript to
send HTTP requests directly to the server, and interact with
the responses returned.

http://jibbering.com/2002/4/httprequest.html
--
Postings such as this are automatically sent once a day. Their
goal is to answer repeated questions, and to offer the content to
the community for continuous evaluation/improvement. The complete
comp.lang.javascript FAQ is at http://jibbering.com/faq/index.html.
The FAQ workers are a group of volunteers. The sendings of these
daily posts are proficiently hosted by http://www.pair.com.

Nov 11 '07 #1
2 2667
In comp.lang.javascript message <47***********************@news.sunsite.
dk>, Sun, 11 Nov 2007 00:00:02, FAQ server <ja********@dotinternet.be>
posted:
>FAQ Topic - How do I run a server side script?
>You trigger a server-side script by setting any object's URL. For
example a frame, window, or an Image. An image will also
"swallow" the data sent back by the server, so that they will
not be visible anywhere.
I'd rewrite that paragraph in English if I could tell what it meant.

The present answer is insufficient, as it has no reference to providing
and positioning the script itself (note : ISPs do not always provide
general server-side scripting).
var dummyImage = new Image();dummyImage.src = "scriptURL.asp?param=" +
varName;
That's a case where with could be with advantage be used, since
AFAICS there's no need to retail the Image object (check that)

with (new Image()) src = "scriptURL.asp?param=" + varName

Using a manifestly generic name part (scriptURL) (which of course isn't
a URL) with a recognisable specific extension suggests that the given
extension is required. Better : "filename.ext?param?" or "file?param".

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Delphi 3? Turnpike 6.05
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.bancoems.com/CompLangPascalDelphiMisc-MiniFAQ.htmclpdmFAQ;
<URL:http://www.borland.com/newsgroups/guide.htmlnews:borland.* Guidelines
Nov 11 '07 #2
Dr J R Stockton said the following on 11/11/2007 3:43 PM:
In comp.lang.javascript message <47***********************@news.sunsite.
dk>, Sun, 11 Nov 2007 00:00:02, FAQ server <ja********@dotinternet.be>
posted:
>FAQ Topic - How do I run a server side script?
>You trigger a server-side script by setting any object's URL. For
example a frame, window, or an Image. An image will also
"swallow" the data sent back by the server, so that they will
not be visible anywhere.

I'd rewrite that paragraph in English if I could tell what it meant.
Then write an answer to the question that you do understand.
The present answer is insufficient, as it has no reference to providing
and positioning the script itself (note : ISPs do not always provide
general server-side scripting).
The answer is incomplete. If you qualify that as "insufficient" then it
is. As far as "positioning the script", not sure what you mean by that.
The fact that some ISP's do not allow server side scripts is irrelevant
though.
>var dummyImage = new Image();dummyImage.src = "scriptURL.asp?param=" +
varName;

That's a case where with could be with advantage be used, since
AFAICS there's no need to retail the Image object (check that)

with (new Image()) src = "scriptURL.asp?param=" + varName
Using a manifestly generic name part (scriptURL) (which of course isn't
a URL) with a recognisable specific extension suggests that the given
extension is required. Better : "filename.ext?param?" or "file?param".
"scriptURL" is in fact a URL. Whether it has the extension or not. It is
a relative URL. There are no extensions on the web though. The parameter
is just as bad as the extension though as it still implies that it might
be "required" when it isn't.

<suggestion for discussion>
FAQ Topic - How do I run a server side script?

You execute a server-side script using client-side script by setting any
object's URL that can have an .href or .src property. For example a
frame, window, or an Image.
</suggestion>

Not sure that "object's URL" is a good term to use there though.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 12 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - What online resources are available? ----------------------------------------------------------------------- ...
20
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I get a perl/asp/php variable into client-side js?...
1
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I run a server side script? ----------------------------------------------------------------------- You...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.