Sparkysgirl
01-28-2005, 11:21 AM
Since I'm having a hard time understanding javascript right now I made my navagaton bar with a program called Xara MenuMaker. Here's the problem - When I add it to my tracts page, which has a script for opening new pages in a new window, the new pages don't open in a new window. They change the page instead. I'm assuming there is some kind of conflict since it was all working fine before I added the navagation bar. Any help I can get to fix this would be greatly appreciated! TIA!! Here's that part of the code if anyone would like to see it:
<script menumaker src="illuminate.js"></script><img src="sideseperator.gif" width="15" height="100%" alt="" border="0">
</td>
<TD ALIGN="left" WIDTH="650" height="100%" table bgcolor="white"><br>
<center><img src="tracts.gif" width="155" height="61" alt="Tracts" border="0"></center><br>
<center>
<table cellspacing="2" cellpadding="2" width="95%" height="75%" class="bgg">
<tr>
<td>
<p align="left" class="bgg"><font color="red">Notice:</font> All of these tracts will open in a new window. We have kept the tract pages clean and free of graphics to make printing easier. For those who would like to print the tracts, there is a print button at the bottom of each page. <br><br><br>
<p align="center" class="head">Children's Salvation/Story Tracts<br></center>
<br><br>
<center><table border="2" bordercolor="#9966cc" cellspacing="3" cellpadding="2" width="95%" height="15%" class="bgg">
<tr>
<td><a href="http://www.bygodsgrace.net/tracts/csst/undersealedorders.html" onclick="newWin(this.href, '500', '500'); return false;">Under Sealed Orders</a></td>
<td><a href="http://www.bygodsgrace.net/tracts/csst/refusedpardon.html" onclick="newWin(this.href, '500', '500'); return false;">He Refused His Pardon</a></td>
<td><a href="http://www.bygodsgrace.net/tracts/csst/drsforgottenbook.html" onclick="newWin(this.href, '500', '500'); return false;">The Doctor's Forgotten Book</a></td>
<td><a href="http://www.bygodsgrace.net/tracts/csst/jimmywenthome.html" onclick="newWin(this.href, '500', '500'); return false;">When Jimmy Went Home</a></td>
</tr>
</table>
<center>
_Aerospace_Eng_
01-28-2005, 11:53 AM
okay first this
<script menumaker src="illuminate.js"></script>
should be this
<script type="text/javascript" src="illuminate.js"></script>
and 2nd where is the javascript for the newwindow function? i dont see it in the code?
chaosyndrome
01-28-2005, 11:54 AM
just add a target="_blank" to the hrefs
like this
<a href="http://www.bygodsgrace.net/tracts/csst/undersealedorders.html" onclick="newWin(this.href, '500', '500'); return false;" target="_blank">Under Sealed Orders</a>
_Aerospace_Eng_
01-28-2005, 11:58 AM
target="_blank" is not going to work in this situation because there is a javascript that should make the windows open at a width of 500 by 500 prolly without menubars, scrollbars, toolbars, status, location and all of that other stuff, target="_blank" will just open a new window with all of its attributes
coothead
01-28-2005, 12:06 PM
Hi there Sparkysgirl,
if there is a conflict between scripts, then we will
need to see them in order to solve the problem. :D
A link to your site would be an added bonus. :)
_Aerospace_Eng_
01-28-2005, 12:41 PM
okay im sure coothead is prolly working something up also but to tell u the truth i didn't see ur window open function anywhere in your page so added it to ur page and corrected the links to open in a 500x500 window with no menubars etc.
coothead
01-28-2005, 12:48 PM
Hi there Sparkysgirl,
as _Aerospace_Eng_ has pointed out you only have ONE script on that page :D
So what have you done with the other one. :supereek:
Sparkysgirl
01-28-2005, 12:58 PM
Well, menumaker made the <script menumaker src="illuminate.js"></script> part of the page. I'm assuming you are needing to see this part which is a seperate page I uploaded to the site:
//©Xara Ltd
var clicked="";var gtype=".gif";var selstate="_over";if (typeof(loc)=="undefined" || loc==""){var loc="";if (document.body&&document.body.innerHTML){var tt=document.body.innerHTML;var ml=tt.match(/["']([^'"]*)illuminate.js["']/i);if(ml && ml.length > 1) loc=ml[1];}}document.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>");tr(false);writeButton("","http://www.bygodsgrace.net/index.html","illuminate_b1",52,38,"Home","",0);writeButton("","http://www.bygodsgrace.net/miracles.html","illuminate_b2",69,38,"Miracles","",0);writeButton("","http://www.bygodsgrace.net/testimony.html","illuminate_b3",90,38,"Testimnoies","",0);writeButton("","http://www.bygodsgrace.net/prison.html","illuminate_b4",106,38,"Prison Ministry","",0);writeButton("","http://www.bygodsgrace.net/tracts.html","illuminate_b5",55,38,"Tracts","",0);writeButton("","http://www.bygodsgrace.net/missions.html","illuminate_b6",70,38,"Missions","",0);writeButton("","http://www.bygodsgrace.net/prayer.html","illuminate_b7",113,38,"Prayer Requests","",0);writeButton("","http://www.bygodsgrace.net/stories.html","illuminate_b8",138,38,"Inspirational Stories","",0);writeButton("","http://www.bygodsgrace.net/poems.html","illuminate_b9",57,38,"Poems","",0);writeButton("","http://www.bygodsgrace.net/songs.html","illuminate_b10",54,38,"Songs","",0);writeButton("","http://www.bygodsgrace.net/newsletter.html","illuminate_b11",82,38,"Newsletter","",0);writeButton("","http://www.bygodsgrace.net/links.html","illuminate_b12",49,38,"Links","",0);writeButton("","http://www.bygodsgrace.net/about.html","illuminate_b13",72,38,"About Us","",0);writeButton("","http://www.bygodsgrace.net/faith.html","illuminate_b14",113,38,"Faith Statement","",0);writeButton("","http://www.bygodsgrace.net/guestbook.html","illuminate_b15",86,38,"Guest Book","",0);writeButton("","http://www.bygodsgrace.net/contact.html","illuminate_b16",83,38,"Contact Us","",0);writeButton("","http://www.bygodsgrace.net/shop.html","illuminate_b17",48,38,"Shop","",0);writeButton("","http://www.bygodsgrace.net/donations.html","illuminate_b18",78,38,"Donations","",0);tr(true);document.write("</tr></table>");loc="";function tr(b){if (b) document.write("<tr>");else document.write("</tr>");}function turn_over(name) {if (document.images != null && clicked != name) {document[name].src = document[name+"_over"].src;}}function turn_off(name) {if (document.images != null && clicked != name) {document[name].src = document[name+"_off"].src;}}function reg(gname,name){if (document.images){document[name+"_off"] = new Image();document[name+"_off"].src = loc+gname+gtype;document[name+"_over"] = new Image();document[name+"_over"].src = loc+gname+"_over"+gtype;}}function evs(name){ return " onmouseover=\"turn_over('"+ name + "')\" onmouseout=\"turn_off('"+ name + "')\""}function writeButton(urld,url,name,w,h,alt,target,hsp){gname=name;while(typeof(document[name])!="undefined")name+="x";reg(gname,name);tr(true);document.write("<td>");if(alt!="")alt=" alt=\""+alt+"\"";if(target!="")target=" target=\""+target+"\"";if(w>0)w=" width=\""+w+"\"";else w="";if(h>0)h=" height=\""+h+"\"";else h="";if(url!="")url=" href=\""+urld+url+"\"";if(typeof(clx)!="undefined"){target="";url=" href=\"?"+clx+"\"";alt=" alt=\"Click to edit\"";}document.write("<a "+url+evs(name)+target+">");if(hsp==-1)hsp=" align=\"right\"";else if(hsp>0)hsp=" hspace=\""+hsp+"\"";else hsp="";document.write("<img src=\""+loc+gname+gtype+"\" name=\""+name+"\""+w+h+alt+hsp+" border=\"0\" /></a></td>");tr(false);}
Wish I understood all this better so I wouldn't have to rely on this program to do this stuff.(And I wouldn't be asking stupid questions here anymore either..) Is this what you needed? Or am I missing something else that SHOULD be on my page but isn't.
Sparkysgirl
01-28-2005, 01:01 PM
Thanks _Aerospace_Eng_, I'm going to give that a try. I'm surprised it ever worked considering I didn't have this on there. :rolleyes:
Sparkysgirl
01-28-2005, 01:04 PM
That fixed it! Thanks so much! (I was given that script by someone else since I couldn't figure it out, but they didn't give me the first part that you gave me.)
_Aerospace_Eng_
01-28-2005, 02:16 PM
lol without that function or something similar like the one i made those links wont open up in the windows sized at 500x500, u may at one time had the script but accidently deleted it, menumaker looks like it may have added a lot of info JUST to get that menu to work when it can work with just some simple javascript rollovers or even css i think for that matter
Sparkysgirl
01-28-2005, 03:13 PM
LOL Thanks for the help. I'm sure that program addd extra stuff to make it look more complicated than it really is - that way people like me will take one look and freak, say forget it and buy their program. ;)
What's the best way to learn javascript? I've been self taught on everything I've learned so far, and as you can see I'm either a bad teacher or a slow learner. :D
_Aerospace_Eng_
01-28-2005, 04:21 PM
do a google search for javascript tutorials, although i am teaching myself javascript slowly without any tutorials, i've taken some C programming classes for school and most of the commands are the same like if statements, and for loops and other types of loops, but when i ran into a problem i would ask in a forum mainly this one
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.