Click to See Complete Forum and Search --> : Webpage stops loading when link is clicked.


jammer20002
09-21-2003, 10:57 AM
I've managed to construct an ASP page that reads JPG file names from a directory, then constructs a page with a table of links to bigger JPG pictures.

I have 2 problems...

1. The webpage takes toooo long to load. I just can't figure out why??

2. If the page hasn't entirely loaded and I click on one of the links, then the original page will stop loading and the other page loads instead. I don't want the original page to stop loading. :(

I've attached the relevant files to this message. Any help would be really appricated.

Thanks.


Jam

bioS
09-21-2003, 03:00 PM
Have you tried

<a href="#" onClick="javascript:yourFunction();return false;">

instead of

<a href="javascript:yourFunction()"> ?

It will maybe resolve your second problem.

jammer20002
09-21-2003, 03:13 PM
Thanks for that.
I'm trying that now.
Can you explain wht the return false does??

Thanks.

jammer20002
09-21-2003, 03:19 PM
I tried that...
But it gives me an error saying: ";return' statement outside of function".

What should I do?
WOuld it be OK to stick it into my function?
I'm trying that right now...

jammer20002
09-21-2003, 03:28 PM
Em... I pu tthat inside my function... and it just took me to a new page saying "false". :)

Anything else? :(

bioS
09-21-2003, 04:15 PM
Hmmm... well...

Actually, to be honnest, I don't really know what the 'return false' is supposed to do. I found this way to write as I was looking for a way to open a new window, without stopping some Gifs to move.

I just tried to remove it, and it works fine... shame on me... ;)

Anyway, I don't know why it gives you an error. You can maybe look at the source code on one of my pages there:
http://www.cttmandement.ch/forum/forumHome.asp
and see if you find something different.

Hope this helps.:)

PS
Don't be afraid, the response time is quite slow on my pages for the moment...:(

jammer20002
09-21-2003, 04:25 PM
Thanks for that...
I had a look at your site and the code behind it...
But I couldn't find a "return false" anywhere?

SURELY there must be a way? :(

I don't think the problem is an ASP one.
The same problem happens without the ASP code.

Any other suggestions?

:confused:

Thanks.

bioS
09-21-2003, 04:28 PM
As I said, I just removed it !

Have you tried without the "return false" ?

jammer20002
09-21-2003, 04:46 PM
:o

Sorry... I kinda scan read your reply.
I didn't have the 'return false' in the first place.

The problem is sitll there.

: (

bioS
09-21-2003, 04:57 PM
you mean you can't open any new window when writing
onClick="javascript:yourFunction()"
instead of
href="javascript:yourFunction()" ??
If you copy my source code, does it work ?

jammer20002
09-21-2003, 05:13 PM
No... you misunderstand. :)

I have the following function:

href="javascript:launchWindowFunction()"

Now I have a table of 30 images, sy for example.

Each image has the above code behind it, so that when clicked, it launches a new popup window.

Everything is fine upto here.

The problem is that lets say the page is loading and only 10 images have been loaded so far. If I click on one of the images then I get a popup window.

BUT... the original window stops loading. It looks mangled up and doesn't look good. I want it to continue loading.

Does that all make sense?

I'm pulling my hair out. :(

bioS
09-21-2003, 05:22 PM
I've understood you problem.

I suggested you to replace 'href' by 'onClick', because I know that 'href' with javascript blocks the mother page, for instance, if you have any animated gif on it, your second window appears, but your gifs stop to move.

I supposed it could be a similar problem with the load of your page and that maybe replacing 'href' by 'onClick' could have resolved your problem.

But if it doesn't...:( I'm afraid I can't help you...

jammer20002
09-21-2003, 05:30 PM
I'll give that a go.
Thanks for the replies.

:)

jammer20002
09-21-2003, 05:42 PM
Hey... it worked!
Thanks for that!

:)

bioS
09-21-2003, 05:47 PM
:D
Great !

I can go to sleep now...? 00h45 in Geneva...

jammer20002
09-21-2003, 06:03 PM
:)

0000 in London...
And I gotta still put in a few more hours...

;)