Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting JavaScript from a server
Message
 
To
14/02/2002 08:25:20
David Fluker
NGIT - Centers For Disease Control
Decatur, Georgia, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00618531
Message ID:
00619965
Views:
15
David,
No, not html at all, just a regular JavaScript. In fact, if you want to return HTML within the script, you have to do a document.write('yourhtml'). The good thing is that you can embed this in any page, HTML static pages or dynamic program generated pages. Check out the polls on our site, www.dotcomsolution.com and http://www.dotcomsolution.com/aspvote_desc.asp. They use this technique. BTW, the same technique can be used for banner ads and any other dynamic content. If you want to see exactly what the Javascript is that's being sent, just pull up the embedded SRC URL on those pages by typing that URL in your browser and download the JS to a file you can look at...
>Claude,
>
>I'm using ASP for my tests because I have easy access to an IIS server, though we'll be using JSP for the code in the actual project. I'll double check what I have to make sure it is all JavaScript.
>Do you return the JavaScript the same way you'd return HTML, just being sure that it's all JavaScript?
>
>Thanks,
>David.
>
>>David, whatever you return in that SRC must be pure JavaScript code. We actually create the JavaScript in VFP dynamically and return it in the SRC...
>>
>>>I have a requirement to populate the city, state, and county fields based upon the zip code. Using a submit repositions the page when it is redrawn and thus fails the usability test. I have seen websites that load JavaScripts built on the fly by using the SRC= to fill page items dynamically. Here is a sample of such a call with the actual server name removed.
>>>
>>>
<SCRIPT LANGUAGE="Javascript" SRC="http://somesite.com/cgi-local/page?getData+js">
>>></SCRIPT>
>>>
>>>When I do it on my server, I get the "Do you want to Run this program or Save it to disk" dialog.
>>>
>>>My question: What do I need in the return document so the Javascript runs in the browser when arrives?
>>>
>>>*Or* does someone have another suggestion to populate the city, state and county from the user entered zip code?
>>>
>>>Thanks,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform