Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with loading frames using javascript

Status
Not open for further replies.

questhaven

Programmer
Mar 28, 2001
81
US
Hi there! I am having a problem with the code below and was hoping someone might see why it is not working as it should. What is supposed to happen is as follows:

When a user clicks on the word "Share" (which is located in the left frame) it is supposed to refresh the left frame with a file called access.asp and refresh the main frame with a file called record_share.asp. Currently the first time the word Share is clicked it refreshes the left frame ok, but it does not refresh the right frame with record_share.asp. However, if I click on the word share a second time then it works correctly. Any ideas as to why this is happening would be greatly appreciated!

Thanks!

<a class=&quot;tabsel2&quot; title=&quot;Share patient&quot; href=&quot;#&quot; onClick=&quot;parent.main.location='record_share.asp';self.location='access.asp'&quot;><FONT color=&quot;#000000!important&quot;>Share</FONT></a>
 
<a class=&quot;tabsel2&quot; title=&quot;Share patient&quot; href=&quot;#&quot; onClick=&quot;parent.main.location='record_share.asp';self.location='access.asp';return false&quot;><FONT color=&quot;#000000!important&quot;>Share</FONT></a>

Using &quot;return false&quot; keeps the link from doing what it normally does.
 
Thank you! I added the return false, however the problem still exists. The first time I click on the link it does not refresh the main frame - the second time I click the same link it does. Does anyone know why this could be happening?
 
how about this instead:

<a class=&quot;tabsel2&quot; title=&quot;Share patient&quot; href=&quot;#&quot; onClick=&quot;parent.main.location='record_share.asp'; self.location.reload(); return true;&quot;><FONT color=&quot;#000000!important&quot;>Share</FONT></a>



=========================================================
try { succeed(); } catch(E) { tryAgain(); }
-jeff
 
Thanks Jeff - I just tried this - but unfortunately this doesnt work either. It refreshes the left frame just fine - but the main frame does not load record_share.asp until I click the Share link a second time.

Any other ideas? :)
 
Can you post the code you are using to define your frameset?
 
Sure! One thing to note - the default page for the main frame is called slides.asp - that is the one that remains in that frame the first time I click the Share link, rahter than record_share.asp which is supposed to load.

Thanks for any help!

<frameset rows=&quot;100,*,23&quot; FRAMESPACING=&quot;0&quot; TOPMARGIN=&quot;0&quot; LEFTMARGIN=&quot;0&quot; MARGINHEIGHT=&quot;0&quot; MARGINWIDTH=&quot;0&quot;>
<frame name=&quot;topframe&quot; src=&quot;headerframe.asp&quot; noresize scrolling=&quot;no&quot; frameborder=&quot;no&quot; TOPMARGIN=&quot;0&quot; LEFTMARGIN=&quot;0&quot; MARGINHEIGHT=&quot;0&quot; MARGINWIDTH=&quot;0&quot; target=&quot;_top&quot;>
<frameset cols=&quot;220,*&quot; border=&quot;0&quot; frameborder=&quot;1&quot; FRAMESPACING=&quot;3&quot; TOPMARGIN=&quot;0&quot; LEFTMARGIN=&quot;0&quot; MARGINHEIGHT=&quot;0&quot; MARGINWIDTH=&quot;0&quot;>

<frameset rows=&quot;100%, 0%&quot; border=&quot;0&quot; frameborder=&quot;1&quot; FRAMESPACING=&quot;0&quot; TOPMARGIN=&quot;0&quot; LEFTMARGIN=&quot;0&quot; MARGINHEIGHT=&quot;0&quot; MARGINWIDTH=&quot;0&quot;>
<!-- check if a new note is clicked, pass the note id to summary.asp page -->
<% if new_note_id = &quot;&quot; then %>
<frame id=&quot;nav&quot; name=&quot;contents&quot; style=&quot;border-left:0px solid white; border-top:0px solid white; border-bottom:0px solid white&quot; target=&quot;contents&quot; TOPMARGIN=&quot;0&quot; LEFTMARGIN=&quot;0&quot; MARGINHEIGHT=&quot;0&quot; MARGINWIDTH=&quot;0&quot; FRAMEBORDER=&quot;no&quot; BORDERCOLOR=&quot;#B9C6F1&quot; scrolling=&quot;yes&quot; src=&quot;summary.asp&quot;>
<% else %>
<frame id=&quot;nav&quot; name=&quot;contents&quot; style=&quot;border-left:0px solid white; border-top:0px solid white; border-bottom:0px solid white&quot; target=&quot;contents&quot; TOPMARGIN=&quot;0&quot; LEFTMARGIN=&quot;0&quot; MARGINHEIGHT=&quot;0&quot; MARGINWIDTH=&quot;0&quot; FRAMEBORDER=&quot;no&quot; BORDERCOLOR=&quot;#B9C6F1&quot; scrolling=&quot;yes&quot; src=&quot;summary.asp?NOTEID=<%=new_note_id%>&quot;>
<% end if %>

<frame name=&quot;note_use&quot; style=&quot;border-left:0px solid white; border-top:0px solid white; border-bottom:0px solid white&quot; target=&quot;contents&quot; TOPMARGIN=&quot;0&quot; LEFTMARGIN=&quot;0&quot; MARGINHEIGHT=&quot;0&quot; MARGINWIDTH=&quot;0&quot; FRAMEBORDER=&quot;no&quot; BORDERCOLOR=&quot;#B9C6F1&quot; scrolling=&quot;yes&quot; src=&quot;note_use.asp&quot;>

</frameset>

<frame name=&quot;main&quot; FRAMEBORDER=&quot;no&quot; scrolling=&quot;yes&quot; BORDERCOLOR=&quot;#B9C6F1&quot; src=&quot;slides.asp&quot;>
</frameset>
<frame name=&quot;bottom&quot; scrolling=&quot;no&quot; noresize target=&quot;contents&quot; src=&quot;footerframe.html&quot; frameborder=&quot;no&quot; TOPMARGIN=&quot;0&quot; LEFTMARGIN=&quot;0&quot; MARGINHEIGHT=&quot;0&quot; MARGINWIDTH=&quot;0&quot;>
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>
 
Ok, how about this...

<a class=&quot;tabsel2&quot; title=&quot;Share patient&quot; href=&quot;record_share.asp&quot; target=&quot;main&quot; onClick=&quot;self.location.href='access.asp'&quot;><FONT color=&quot;#000000!important&quot;>Share</FONT></a>
 
Thanks so much for taking the time to look into this - but unfortunately this isnt working either. The first click on Share only is reloading the left frame. The right frame still does not reload until the second time I click on Share...
 
Ok - I figured it out - I am really sorry to take up your time. There is also a referring page that needs to contain the onClick code as well in order for the first click on Share to work. Thanks SO much for all of your help!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top