Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / JScript / September 2003

Tip: Looking for answers? Try searching our database.

Replace()  src

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Emmanuel Soheyli - 23 Aug 2003 20:21 GMT
I get information from an outside site by the following code:

<script src="http://www.outside.com/page.asp?id=1"></script>

It generates array 'content with all necessaries information. The problem is
I need several type of information (id=2,3, etc.), and it always generate
the same array content (as name) with different contents .how can I change
the name of the array to other things in order to get different arrays. Any
help would be greatly appreciated.
Code Ronin - 05 Sep 2003 04:43 GMT
> <script src="http://www.outside.com/page.asp?id=1"></script>

Okay, so you are using an ASP page to dynamically generate the
JavaScript, right? (You should be, because that is the result of
putting that kind of URL in the src attribute of a script element.)

> It generates array 'content with all necessaries information. The problem is
> I need several type of information (id=2,3, etc.), and it always generate
> the same array content (as name) with different contents. how can I change
> the name of the array to other things in order to get different arrays.

You need to be a little clearer on what your intent is.

You say that "it always generate[s] the same array content (as name)
with different contents." I interpret that to mean "a variable, which
is an array, is set to different information based upon whether the id
is 1, 2, or 3, but it always sets it to the name variable name. How
can I have it set to a different variable name?" Is that correct?

If so, the code in your ASP, which is currently determining if id is
1, 2, or 3 (in order to set the contents differently) also sets a
different name. Let us assume that the value of id is set to a
variable named "paramId":

if ( paramId == 1 ) {
 var arrayId1 = { ... some contents ... };
} else if ( paramId == 2 ) {
 var arrayId1 = { ... some other contents ... };
} etc.

If you are using this information on the client-side in some way, you
can check to see is arrayId1, arrayId2, etc. exists, and if so, is an
array.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.