473,473 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Replace src

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.

Jul 20 '05 #1
3 4358
In article <u8*****************@nwrddc03.gnilink.net>, "Emmanuel Soheyli"
<vz******@verizon.net> writes:
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.


Assuming you are wanting to make repeated calls to the same asp page to get
different results back?

Simply set a new array = to the existing array
myArray = new Array()
//definitions for myArray

myArray2 = myArray;

//myArray2 is now a complete copy of myArray

Hope this helps.
--
Randy
All code posted is dependent upon the viewing browser
supporting the methods called, and Javascript being enabled.
Jul 20 '05 #2
"Emmanuel Soheyli" <vz******@verizon.net> wrote in message news:<u8*****************@nwrddc03.gnilink.net>...
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.


Dunno if I understand your question or not, but if you are importing
several variables with the same name, you might just copy the values
each time, as:

// x.js
var bill = 'x';

//y.js
var bill = 'y';

// a.htm
<script type='text/javascript'>
var bills = [];
</script>
<script type='text/javascript' src='x.js' ></script>
<script type='text/javascript'>
bills[0] = bill;
</script>
<script type='text/javascript' src='y.js' ></script>
<script type='text/javascript'>
bills[1] = bill;
var s = '';
for(var i = 0; i < bills.length; i++){
s += i + ': ' + bills[i] + "\n";
}
alert(s);
</script>
Just a thought.

Not an expert, so FWIW.
Jul 20 '05 #3
Thank you for your reply, and it was a very genial solution, but I got the
same result. Maybe I didn't use it correctly. Let me explain what exactly is
going on. this script <script src="http://source.asp?id=1> generates an
array named content and it fills this array with content[0]= text0,
content[1]=text1 etc.

on my page I have the following code

<script src="http://source.asp?id=1>

<script> Content1 = content

some codes to treat the content1.

</script>

<script src="http://source.asp?id=2>

<script> Content2 = content

some codes to treat the content2.

</script>

but Content1 is filled by the result of the last call and I'm loosing the
first array of data. Thanks again for any other ideas.

"HikksNotAtHome" <hi************@aol.com> wrote in message
news:20***************************@mb-m26.aol.com...
In article <u8*****************@nwrddc03.gnilink.net>, "Emmanuel Soheyli"
<vz******@verizon.net> writes:
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 isI 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 changethe name of the array to other things in order to get different arrays. Anyhelp would be greatly appreciated.
Assuming you are wanting to make repeated calls to the same asp page to

get different results back?

Simply set a new array = to the existing array
myArray = new Array()
//definitions for myArray

myArray2 = myArray;

//myArray2 is now a complete copy of myArray

Hope this helps.
--
Randy
All code posted is dependent upon the viewing browser
supporting the methods called, and Javascript being enabled.

Jul 20 '05 #4

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

Similar topics

4
by: Craig Keightley | last post by:
Can these lines of sql statements be consolidated into one sql statement (possibly using reg exps??) BEGIN CODE ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Update...
12
by: Barnes | last post by:
Does anyone know of a good way to use the JavaScript string.replace() method in an ASP form? Here is the scenario: I have a form that cannot accept apostrophes. I want to use the replace() so...
6
by: Danny | last post by:
I need an asp command to strip out from a string all extra punctuation such as apostrophe, comma, period, spaces dashes, etc etc and just leave the letters. Can anybody give me some ideas? ...
9
by: Peter Row | last post by:
Hi, I know this has been asked before, but reading the threads it is still not entirely clear. Deciding which .Replace( ) to use when. Typically if I create a string in a loop I always use a...
4
by: Cor | last post by:
Hi Newsgroup, I have given an answer in this newsgroup about a "Replace". There came an answer on that I did not understand, so I have done some tests. I got the idea that someone said,...
3
by: Goran Djuranovic | last post by:
Hi all, I ran into a problem where my XMLTextReader fails on .Read() when I have "<" character in one of the attribute's values. What I am trying to do is replace illegal characters ("<", "&" ,...
3
by: TOXiC | last post by:
Hi everyone, First I say that I serched and tryed everything but I cannot figure out how I can do it. I want to open a a file (not necessary a txt) and find and replace a string. I can do it...
6
by: JackpipE | last post by:
Here is my replace query and I need to run this on every column in my table. Right now I manually enter the column name (_LANGUAGES_SPOKEN) but this is time consuming and would like to automate...
5
by: V S Rawat | last post by:
I was trying to use back-to-back replace functions to convert a url: str1 = str.replace("%2F","/").replace("%3F","?").replace("%3D","=").replace("%2 6","&"); It didn't replace all 4 types of...
15
by: =?Utf-8?B?TWlrZSAiWU9fQkVFIiBC?= | last post by:
I have a text file that contains about 8 to 10 text sequences that I need to replace. I want to search and replace all 8 to 10 text sequence anytime I run this script Here is what I have so...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.