473,788 Members | 2,837 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

links array not updating

Hi,

I have 3 frames. One to let the user input a URL, one to display the
page of that URL and one to display some info on that page (including
all the links of the page).

The problem is that when loading a new page into the frame, the links
do not update in the other frame until I've loaded the page twice. It
appears that the actual values in the links array do not update until
after loading for the 2nd time. This is my script:

function loadNewUrl()
{
var i;
var theNewURL

// Load the new web page into the left frame

parent.leftWind ow.location=doc ument.url_input .url.value;

theNewURL = document.url_in put.url.value;

// Display the url of the new web page in the right frame
parent.rightWin dow.document.cl ose();
parent.rightWin dow.document.op en();
parent.rightWin dow.document.wr ite("<B> URL: </B>");
parent.rightWin dow.document.wr ite("<br>");
parent.rightWin dow.document.wr ite(theNewURL);
parent.rightWin dow.document.wr ite("<br> <br>");

// Display all the link targets of the new web page in the right frame
parent.rightWin dow.document.wr ite("<B> LINKS: </B>");
parent.rightWin dow.document.wr ite("<br>");

for(i=0; i<parent.leftWi ndow.document.l inks.length; i++)
{
parent.rightWin dow.document.wr ite(parent.left Window.document .links[i].href);
parent.rightWin dow.document.wr iteln("<br>");

}

parent.rightWin dow.document.cl ose();
}
//-->
</script>
Can anyone see a reason why this shouldn't work?

Thank you - in advance
tommy
Jul 20 '05 #1
1 1781
Lee
Tommy said:

Hi,

I have 3 frames. One to let the user input a URL, one to display the
page of that URL and one to display some info on that page (including
all the links of the page).

The problem is that when loading a new page into the frame, the links
do not update in the other frame until I've loaded the page twice. It
appears that the actual values in the links array do not update until
after loading for the 2nd time. This is my script:
Can anyone see a reason why this shouldn't work?


It takes time for a page to load into a frame.
You're trying to access the list of links in the first frame before
the page has finished loading.

Jul 20 '05 #2

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

Similar topics

2
16295
by: Håvard Olerud Eriksen | last post by:
I've been working on a webshop, and I've got most of the functionality up and running. One problem, however, that I don't seem to be able to solve is as follows. My shopping cart is stored in $_SESSION array. As I need to keep tabs on what items are ordered and their quantity I add elements like this: array_push($_SESSION,array($item => $quantity)); If I add three elements and then var_dump the global variable it spits out: array(3) { =>...
3
10447
by: Mark A Framness | last post by:
Greetings, I am working on a project and we need to write a conversion script to initialize a new field on a table. The number of records on this table is on the order of millions so routine selection and update takes a long time. I am tasked with writing a pl/sql proc that utilizes array processing to update the column.
5
3326
by: Sally B. | last post by:
Hello, I searched, but couldn't find answers--probably because I'm not sure what this is called... Anyway, I have about 50 web pages and I want to have some JavaScript that will read in a list of keywords, scan the web page and create links on any of those keywords... Is there any way to do this sort of thing? Thanks!
5
2102
by: Kruegy Man | last post by:
I have a WinForm application that has a WebBrowser Control. I can navigate to any website fine. I want to store the link addresses in an array to be called back later. For example, if I visit a news website's main page (www.newswebsite.com), they will have links to other stories. The links' address usually appears in the status bar when you mouse over the link (say for example, www.newswebsite.com/story1).
1
2376
by: Robin | last post by:
Hello! I'm having trouble with links and hyperlinks in MS Access 2003 - any help would be great! Question 1! The "insert hyperlink" icon opens a browser window, allows the user to browse to the desired file and paste the hyperlink on the form (which obviously remains for on all the records). I am trying to create a
5
2101
by: aaron.m.johnson | last post by:
I have an application which contains an Access database with linked tables that point to another database within the application. The problem I have is that when the user installs the application, I need to update the table links so that the paths are correct for the install directory. Is there an easy way to accomplish this? I'd really like to avoid duplicating the data in the linked tables, but if updating the links is too much work,...
6
2726
by: sgottenyc | last post by:
Hello, If you could assist me with the following situation, I would be very grateful. I have a table of data retrieved from database displayed on screen. To each row of data, I have added action buttons, such as "Edit", "Add", and "Comment". Since I do not know how many rows of data will be retrieved - and therefore how many buttons I need - I am using button arrays for each button, like so: echo "<input type=\"submit\"...
20
3709
by: Xcriber51 | last post by:
Hi -- I'm not entirely familiar with the norms and standard libraries of JavaScript so if the answer to this is yesterday's news, please ignore. I'm trying to write a simple text formatting function to make headings proper case -- i.e. first letter of words capitalized. I first tried this...
2
3140
iam_clint
by: iam_clint | last post by:
/*###############################*/ /* Link fade script by iam_clint, bytes.com */ /* www.bytes.com, If you use this script on your site */ /* Please keep this comment at the top of the javascript */ /*###############################*/ window.onload=function() { setupLinks(); } var red=0; /*base 16*/ var green=15; /*15 because I want the faded in color to be super green*/
0
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10366
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9969
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7518
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5399
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3675
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.