JavaScript - Links Not Working
I'm a beginner. My links are not working in this js script. The menu renders properly, but nothing happens when I click the link. Thanks, Ed
[code] <HTMl> <head> <title>JavaScript Example</title> <script language="JavaScript"> // Create array to hold four URLs; var dest = new Array(4); dest[0] = window.location.href; dest[1] = "http://www.journey.maryanngoble.com/"; dest[2] = "http://www.facebook.com/bluegrasscreative/"; dest[3] = "http://www.campbellsville.edu"; function go(d) { // Change location of current window one selected from menu // d.menu.options.selectedIndex returns a number that corresponds // to the choice they selected in the pop up menu on the form // If a user selected the first choice, selectedIndex = 0 and the // URL will be set to dest[0] or http://www.bluegrasscreative.com/ window.location.href = dest[d.destination.options.selectedIndex]; // Open new window with selected location // var x = window.open(dest[d.destination.options.selectedIndex],"New Window"); // To set the URL for another frame in this frameset // top.framename.location.href = dest[d.menu.options.selectedIndex]); } </script> </head> <body bgcolor="white"> <form name="x"> <label for="destination"><h3>Where do you want to go?</h3></label> <select id="destination" onchange="go(x)"> <option>Quick Links</option> <option value="1">MaryAnn's blog</option> <option value="2">BGC Facebook</option> <option value="3">Campbellsville University</option> </select> </form> </body> </html> [code] Similar TutorialsOk, here's the page as it is right now: http://www.crackin.com/dev/index.php The paganation for the top 3 images is Sweet Pages: http://tutorialzine.com/2010/05/swee...tion-solution/ The content loading below is a page-replace script I got he http://css-tricks.com/dynamic-page-replacing-content/ And I'm also trying to integrate shadowbox (or lightbox, whichever will work) into the lower set of images. I have 2 problems right now I can't figure out, and I'm sure it somehow has to do with the fact I'm trying to mash 3 different JS addons into a single page, I'm still pretty new to this whole JS thing... First problem I'm having is that IE7 and Opera don't like the links in the upper images. Clicking a gallery image does not load the associated page below from those 2 browsers, however IE8 and FF seem to work fine. Second problem is getting shadowbox/lightbox to work on those lower images. I tried a couple different things but main thing I did is make sure the script is actually working by setting the header text to a link with shadowbox attached and that worked. That same link doesn't work when applied to the lower images (loads image in new window). Lightbox does the same thing. Thanks for any help. I hate javascript.... OK, here's my latest challenge with Javascript. I recently went into twp php files and made a few very minor changes to some outdated $date functions. Now, I have three small icons for 'copy', 'paste','delete' using the javascript 'onclick' function that have stopped working. In fact, when I replace the two recently revised files with the originals, these icons no longer work there either. Any help would be appreciated. I'm simply at a total loss for ideas here. From the primary php file is the relevant lines of source code....As far as I can tell, the second paragraph in each area is returning a 'null' value; i.e. o1a.options.selectedIndex is null. Code: function aCopy(dt){ o1a = document.getElementById("avail_1a_" + dt); o1b = document.getElementById("avail_1b_" + dt); o2a = document.getElementById("avail_2a_" + dt); o2b = document.getElementById("avail_2b_" + dt); o3a = document.getElementById("avail_3a_" + dt); o3b = document.getElementById("avail_3b_" + dt); avail_1a = o1a.options.selectedIndex; avail_1b = o1b.options.selectedIndex; avail_2a = o2a.options.selectedIndex; avail_2b = o2b.options.selectedIndex; avail_3a = o3a.options.selectedIndex; avail_3b = o3b.options.selectedIndex; } function aPaste(dt){ o1a = document.getElementById("avail_1a_" + dt); o1b = document.getElementById("avail_1b_" + dt); o2a = document.getElementById("avail_2a_" + dt); o2b = document.getElementById("avail_2b_" + dt); o3a = document.getElementById("avail_3a_" + dt); o3b = document.getElementById("avail_3b_" + dt); o1a.options.selectedIndex = avail_1a; o1b.options.selectedIndex = avail_1b; o2a.options.selectedIndex = avail_2a; o2b.options.selectedIndex = avail_2b; o3a.options.selectedIndex = avail_3a; o3b.options.selectedIndex = avail_3b; } function aDelete(dt){ o1a = document.getElementById("avail_1a_" + dt); o1b = document.getElementById("avail_1b_" + dt); o2a = document.getElementById("avail_2a_" + dt); o2b = document.getElementById("avail_2b_" + dt); o3a = document.getElementById("avail_3a_" + dt); o3b = document.getElementById("avail_3b_" + dt); o1a.options.selectedIndex = 0; o1b.options.selectedIndex = 0; o2a.options.selectedIndex = 0; o2b.options.selectedIndex = 0; o3a.options.selectedIndex = 0; o3b.options.selectedIndex = 0; From the supporting php file are the following lines of code.... Code: $s .= "<td nowrap=nowrap class=calendar style='border-left:1px dashed #000;'>"; $s .= "<a href='javascript:void(0);' onclick=\"aCopy('$year-$month-$d');\"><img src='../admin/_calendar/Copy.gif' alt='Copy Availability' width='16' height='16' border='0' /></a>"; $s .= " <a href='javascript:void(0);' onclick=\"aPaste('$year-$month-$d');\"><img src='../admin/_calendar/Paste.gif' alt='Paste Availability' width='16' height='16' border='0' /></a>"; $s .= " <a href='javascript:void(0);' onclick=\"aDelete('$year-$month-$d');\"><img src='../admin/_calendar/Delete.gif' alt='Delete/No Availability' width='16' height='16' border='0' /></a>"; $s .= "</td>"; None of these lines of code were changed or altered when I was updating the code. Any thoughts or suggestions would be deeply appreciated? Talltom Hi. I'm Matthew, the creator of the Easing Slider Wordpress plugin. Currently I'm working on the next update of the slider which is to allow the user to assign a link to each image. This is working fine with the slide animations but is creating problems with the fade animation (note I'm using jQuery). Here are the two issues: 1) Using .animate({opacity:0}) & .animate({opacity:1}) the slider is only linking to the link assigned to the last image in the slider. The links are supposed to link: 1. google.com, 2. hotmail.com & 3. fadebook.com. However the slider is only linking to the last link (facebook.com). 2) Using .fadeIn & .fadeOut everything appears to work correctly and the links correspond to the images however when using the pagination before the image has finished fading can cause the images to disappear or appear not fully faded. You can see the overall code he http://pastebin.com/9JwaM9tg (check lines 72, 215 & 216) Example (using .animate): http://www.matthewruddy.com/demo/ I've spent ages trying to figure this out but I really am struggling and cannot find a solution. Many people use the fade effect and I don't particularly want to get rid of it but I will have to if I can't find a solution. I would appreciate if anyone could help me out. Thanks in advance. Matthew. Hi All, I have two sites using zeroclipboard (hosted at google code) one works only in firefox and barely, the other is not working at all. It does use Flash, but I think the issue is on the js side of things. On both links, clicking the filename below the thumbnail will copy and add the link as an IMG code to a div below. *working* link http://pics.boasbysatyra.com/access/spiders.php This one only works in FF, and the clip area is offset badly. Here is the template for the zc code: Code: <div class="photo" style="float: left; padding: 4px;"> <div class="exif"><a href="[~41~]?dir=[+images_dir+]&file=[+filename+]" rel="shadowbox[exif_[+content_id+]]" title="exif data for [+filename+]" alt="exif data for [+filename+]">EXIF Data</a></div> <a class="thumb" rel="shadowbox[[+content_id+]]" href="[+images_dir+][+filename+]" title="[+title+] | [+description+]"> <img src="[+thumbs_dir+][+filename+]" alt="[+title+]" /> </a> <div class="filecode" id="d_clip_button[+filename+]">[+filename+] <script language="JavaScript"> var clip = new ZeroClipboard.Client(); clip.setText( 'http://pics.boasbysatyra.com[+images_dir+][+filename+]' ); clip.glue( 'd_clip_button[+filename+]' ); clip.addEventListener( 'onComplete', my_complete ); function my_complete( client, text ) { $('.picklist').append('<div class="piclinks">[IMG]' + text + '[/IMG]</div>'); } </script> </div> </div> And the JS for the page: Code: var needRef; //flag for page reload function pEdit(){ needRef = 1; } Shadowbox.init({ handleOversize: "resize", modal: true, initialHeight: 32, initialWidth: 400, overlayOpacity: 0.85, onClose: function(){//check for reload flag and reload if (needRef == 1){window.location.href=window.location.href;} } }); ZeroClipboard.setMoviePath('/js/zc/ZeroClipboard10.swf'); function initMenu() { $('#menu ul').hide(); $('#menu ul:first').show(); $('#menu li a').click(function() { var checkElement = $(this).next(); if ((checkElement.is('ul')) && (checkElement.is(':visible'))) { //return false; } if ((checkElement.is('ul')) && (!checkElement.is(':visible'))) { $('#menu ul:visible').slideUp('normal'); checkElement.slideDown('normal'); return false; } }); } $(document).ready(function() { initMenu(); }); Now on to the totally broken one - it creates the elements required, but gives them a 0x0 area! http://jb.boasbysatyra.com/forum-pic...cs/nature.html Code: div class="photo" style="float: left; margin: 4px;"> <div class="exif"><a href="[~133~]?dir=[+images_dir+]&file=[+filename+]" rel="shadowbox[exif_[+content_id+]]" title="exif data for [+filename+]" alt="exif data for [+filename+]">EXIF Data</a></div> <a class="thumb" rel="shadowbox[[+content_id+]]" href="[+images_dir+][+filename+]" title="[+title+] | [+description+]"> <img src="[+thumbs_dir+][+filename+]" alt="[+title+]" /> </a> <div id="d_clip_container[+filename+]" style="position:relative; width: 120px; height: 0.5em;"> <div class="filecode" id="d_clip_button[+filename+]">[+filename+] <script language="JavaScript"> var clip = new ZeroClipboard.Client(); clip.setText( 'http://jb.boasbysatyra.com[+images_dir+][+filename+]' ); clip.glue( 'd_clip_button[+filename+]','d_clip_container[+filename+]' ); clip.addEventListener( 'onComplete', my_complete ); function my_complete( client, text ) { $('.picklist').append('<div class="piclinks">[IMG]' + text + '[/IMG]</div>'); } </script> </div> </div> </div> On this one I wrapped it as suggested on the zc site, I originally started with the code for the other site - it didn't work, so I went tweaking... Here is the JS: Code: var needRef; //flag for page reload function pEdit(){ needRef = 1; } Shadowbox.init({ handleOversize: "resize", modal: true, initialHeight: 32, initialWidth: 400, overlayOpacity: 0.85, onClose: function(){//check for reload flag and reload if (needRef == 1){needRef = 0; window.location.href=window.location.href;} } }); ZeroClipboard.setMoviePath('/js/zc/ZeroClipboard10.swf'); $(document).ready(function() { $(".dim img").fadeTo("slow", 0.65); $(".dim img").hover(function(){ $(this).fadeTo("slow", 1.0); },function(){ $(this).fadeTo("slow", 0.65); }); $('#mainContent').hide().fadeIn(1200); //When page loads... $(".tab_content").hide(); //Hide all content // $("ul.tabs li:first").addClass("active").show(); //Activate first tab // $(".tab_content:first").show(); //Show first tab content //On Click Event $("ul.tabs li").click(function() { $("ul.tabs li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active ID content return false; }); }); (function($) { $(document).ready(function(){ $('.menu1').ptMenu(); $('.menu2').ptMenu({vertical:true}); }); })(jQuery); I have taken a look at this for a few days and tried many things with no luck, any help is appreciated. Thanks! I hope I have this post in the right place! Any help would be very much appreciated... I have a feature on my website that allows users to choose the website background (using alternate css sheets) and then uses an externally linked javascript file to store the background choice as a cookie so it is consistent throughout the website. This works perfectly locally (i.e. when previewing my website on my computer) but now it is uploaded to my host it doesn't appear to be working. (with the same browser) My javascript is he http://www. b r p - e n v .com/javascript/backgroundchange.js (with no spaces) The website that the javascript file is linked to is http://www. b r p - e n v .com (with no spaces) In the head I have: <script type="text/javascript" src="../javascript/backgroundchange.js"></script> ...then I have: <body onload="set_style_from_cookie()"> ...and for users to choose which background: <form> <input type="image" src="../images/white-background-thumb.jpg" onclick="switch_style('bg1');return false;" name="theme" value="White" id="bg1"> etc... </form> My problem is: The background reverts back to the default when moving to a different page. This would indicate that the background choice is not being saved in cookies. But this works locally! I have tried putting the javascript directly onto each page but I still had the same problem. I hope someone can help, I will be so grateful if I can get this to work. Many thanks indeed! hereis the html file and javascripton click of this button a html ***************************** <table class=matcolor id=topnav cellspacing=0 cellpadding=0 width=550 border=0 bgcolor="#FFCCCC"> <tbody> <tr align=middle> <td id=menu1 onMouseOver="this.className='mPrimaryOn';showmenu(this);" onClick="this.document.location.href=''" onMouseOut="this.className='mPrimaryOff';hidemenu(this);" class="mat" height="20"> <div align="center"><font color="#FF0000">Desk Top Publishing </font></div> </td> <td width=1 bgcolor=#ff9900 class="mat"></td> <td id=menu2 onMouseOver="this.className='mPrimaryOn';showmenu(this);" onClick="this.document.location.href=''" onMouseOut="this.className='mPrimaryOff';hidemenu(this);" class="mat" height="20"> <div align="center"><font color="#FF0000">Transcription</font></div> </td> <td width=1 bgcolor=#ff9900 class="mat"></td> <td id=menu3 onMouseOver="this.className='mPrimaryOn';showmenu(this);" onClick="this.document.location.href=''" onMouseOut="this.className='mPrimaryOff';hidemenu(this);" class="mat" height="20"> <div align="center"><font color="#FF0000">Accounts Processing </font></div> </td> </tr> </tbody> </table> ***************************************** <script language=JavaScript> ix = document.getElementById('tblmenu1').getBoundingClientRect(); new ypSlideOutMenu("menu1", "right",ix.left + ix.right ,ix.bottom + 10); </script> **any thing i have to alter to work in firefox please help I have a usercontrol which get inputs from the user and show the slideshows. I have added jquery.js and jqfancytransitions.js to the control. when i apply the effects dynamically it is working on local iis but the same coding is not working on iis server. The link for the page is http://www.gloriatech.com/slideshow.aspx . Actually it display the images but no effects are applied. I also checked the js files, it is in right path only.When i checked this page in firebug , it shows the error which is " Sys is undefined". I dont know how to solve it. Can anyone help me? Thanx in advance. hello I,m using js to parse an XML file. the values from each node are written into an HTML table. this all works fine. however when I try to read a web address from the XML and use it as the href in my <a> tag the page jumps straight to the URL specified. how can I prevent this happening? I am trying to build a function that when a link is checked, the js will check it for its top level domain and if it is other than a .gov, will produce an alert. What I have come up with is the following: Code: $domains = array(".aero",".biz",".cat",".com",".coop",".edu",".info",".int",".jobs",".mil",".mobi",".museum", ".name",".net",".org",".travel",".ac",".ad",".ae",".af",".ag",".ai",".al",".am",".an",".ao",".aq",".ar",".as",".at",".au",".aw", ".az",".ba",".bb",".bd",".be",".bf",".bg",".bh",".bi",".bj",".bm",".bn",".bo",".br",".bs",".bt",".bv",".bw",".by",".bz",".ca", ".cc",".cd",".cf",".cg",".ch",".ci",".ck",".cl",".cm",".cn",".co",".cr",".cs",".cu",".cv",".cx",".cy",".cz",".de",".dj",".dk",".dm", ".do",".dz",".ec",".ee",".eg",".eh",".er",".es",".et",".eu",".fi",".fj",".fk",".fm",".fo",".fr",".ga",".gb",".gd",".ge",".gf",".gg",".gh", ".gi",".gl",".gm",".gn",".gp",".gq",".gr",".gs",".gt",".gu",".gw",".gy",".hk",".hm",".hn",".hr",".ht",".hu",".id",".ie",".il",".im", ".in",".io",".iq",".ir",".is",".it",".je",".jm",".jo",".jp",".ke",".kg",".kh",".ki",".km",".kn",".kp",".kr",".kw",".ky",".kz",".la",".lb", ".lc",".li",".lk",".lr",".ls",".lt",".lu",".lv",".ly",".ma",".mc",".md",".mg",".mh",".mk",".ml",".mm",".mn",".mo",".mp",".mq", ".mr",".ms",".mt",".mu",".mv",".mw",".mx",".my",".mz",".na",".nc",".ne",".nf",".ng",".ni",".nl",".no",".np",".nr",".nu", ".nz",".om",".pa",".pe",".pf",".pg",".ph",".pk",".pl",".pm",".pn",".pr",".ps",".pt",".pw",".py",".qa",".re",".ro",".ru",".rw", ".sa",".sb",".sc",".sd",".se",".sg",".sh",".si",".sj",".sk",".sl",".sm",".sn",".so",".sr",".st",".su",".sv",".sy",".sz",".tc",".td",".tf", ".tg",".th",".tj",".tk",".tm",".tn",".to",".tp",".tr",".tt",".tv",".tw",".tz",".ua",".ug",".uk",".um",".us",".uy",".uz", ".va",".vc", ".ve",".vg",".vi",".vn",".vu",".wf",".ws",".ye",".yt",".yu",".za",".zm",".zr",".zw"); if ($domains == true) { alert(); } else { //do nothing } I am not truly fluent with js and need help with the function. My idea is to get away from having to apply an onclick/onkeypress to each link and apply this code externally or in line to each page. Any suggestions? Thanks Alan i'm having problems getting the functions i created to do the same thing i got it to do for 1 id, for 5 other ids. i basically want 6 images to change when someone does mouseover,out,down, and up (the button technique). this is what i have so far for 1 of them: Code: function mouseOver() { document.getElementById("about").src ="images/splash_up_04.png"; } function mouseOut() { document.getElementById("about").src ="images/splash_04.png"; } function mouseDown() { document.getElementById("about").src ="images/splash_down_04.png"; } function mouseUp() { document.getElementById("about").src ="images/splash_up_04.png"; } and the html for it is: Code: <div id="slice_4"><a href="#"><img alt="" src="images/transparent_splash_04.png" id="about" onmouseover="mouseOver()" onmouseout="mouseOut()" onmousedown="mouseDown()" onmouseup="mouseUp()" /></a></div> i have 5 more links i need to have to do the same thing that this one does.. only problem is, i'm striking out figuring out how exactly to accomplish it any help would be appreciated, or links that would put me on the right path. thanks again <3 Im trying to run javascript on a page, that has a regular frame, and get all the links from the frame. However im not very good at javascript which makes this much harder This is the script im trying to use: Code: javascript: for(var i=0; i<window.frames.length; i++){for (i=0; i < document.links.length; i++) { alert(document.links[i].href); }}; Hello everyone, I have a situation where in my navigational menu (which is an unordered list) when someone has Internet Explorer that it takes them to a different link than if they have a different browser. It is a long story why I need it to do this but suffice it to say, it has to be that way. Is there any script would allow for such a thing? And by the way it has nothing to do with different browser CSS capabilities, I know how to do that already. I am relying on you Zen coders out there whose wisdom far exceeds mine. (Which is definitely not hard to do..) here is an example of the problem (and how to produce it): 1) go to http://eataustineat.com/testfolder/index.php 2) type in an 'a' into the text field 3) click "view results" 4) select the first result (ie: Dog Almighty) Notice the javascript slide doesn't happen. In fact, nothing appears to happen. It is suppose to slide the content to the left much like it did when you hit "view results". Why? I hope this clears the problem up some. So my goal was to insert a mini ICO image (of an R) and have it be a link to an external news page for each individual player on a fantasy team. The code below gets the proper link to each player and inserts the image and corresponding link one at a time though a couple different functions. I have inserted the IMG successfully (see attached), but I am having issues with the link. There are times when the images load accurately with the correct link and others when some of the 'href' elements say undefined. And it isn't consistent either, as to imply that it is a specific coding error. It is completely random and sometimes they are even all correct. Could this have something to do with the asynchronicity of the GM_xmlhttprequests and the loop? If so, is there some way to get around that? This is the bottom of the code which gets fed an array teamURL with all the proper URLs. All of the variables and arrays have the correct information, as they have been checked and double checked. It is almost as if I need a way to slow down the loop to let it do its thing... if that makes any sense. Code: var count = 0; var item = 0; for (var k=0; k< myPlayersArray.length; k++) { GM_xmlhttpRequest({ method:"GET", url:teamURL[k], headers:{"User-Agent":"Mozilla/5.0","Accept":"text/xml"}, onload:function(response){findInfo(response);} }) ; } var allElements = document.evaluate("//*[contains(@href, 'http://sports.yahoo.com/nfl/players/')]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null); var baseRotoworldURL = 'http://www.rotoworld.com'; function findInfo( response ) { var doc = document.createElement( "div" ) ; doc.innerHTML = response.responseText ; //Get appropriate td data on the rankings page var teamPageList = document.evaluate("//a[contains(@href, 'player')]",doc,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null); for (var m=0; m<teamPageList.snapshotLength; m++) { if ((teamPageList.snapshotItem(m).innerHTML.toString()) == (myPlayersArray[count].toString())) { var playerHTML = teamPageList.snapshotItem(m).parentNode.innerHTML; var match = playerHTML.match(/\/nfl\/\d{1,10}\/[a-z]+\-[a-z]+/); var playerURL = baseRotoworldURL +"/recent" + match break; //loop until you get a hit } } addGameLogIcon(allElements, playerURL); count++; } function addGameLogIcon(allElements, playerURL) { var thisElement; var rotoworldLink; var rotoworldLinkGraphic = "data:image/gif;base64,"+"AAABAAEADw8AAAEAGAA0AwAAFgAAACgAAAAPAAAAHgAAAAEAGAAAAAAAAAAAAEgAAABIAAAAAAAAAAAAAADR09TR09TR0tPR0tPQ0tPQ0tPQ0tPQ0dTQ0tPQ0tPQ0tPQ0dPQ0tPR09TR09S9AADR09TR09TP0dOvssuan8acocfFx9HQ0tPGyNGdocean8edocfDxdDR09TR09S9AADR09TR09TGydFHRsEsKNsrJ9SGicLP0dNsb74rJ9csKNsrJ8iTlcPR09TR09S9AADR09TR09TEx9BFRcYvKu0sKOOChcK3ucwuKsgvKu0uKedUVMDIydHR09TR09S9AADR09TR09TEx9BERMQuKOcsJ9+ChcFnaLstJ+IuKOc0McuqrMnQ0tTR09TR09S9AADR09TR09TEx9BERMItKOEsJ9lfYbYuKsQtKOEsJ9hxc7/P0NPQ0tPR09TR09S9AADR09TR09TEx9BERMAsJ9srJ9gqJsgrJ9ksJ9sqJsdub7vJytHQ0tPR09TR09S9AADR09TR09TEx9BEQ70sJ9QsJ9UsJtQsJ9QsJtUsJtQrJspzdb3Q0dPR09TR09S9AADR09TR09TEx9BEQ7stJc4sJco8OrZJSLkxLbotJc0tJs49Ori/wM7R09TR09S9AADR09TR09TEx9BDQ7ksJ8gsJsN6fL3Bw855e7wrJcIsJ8c5Nrm7vs3R09TR09S9AADR09TR09TEx9BEQ7YtJ8IsJ780MLE+O7QuKrYsJ8EtJ8I/PLTBws/R09TR09S9AADR09TR09TEx9BERLUtKMEtKMEtJ8EtJ8EtJ8AsJ8EtKLh7fL3P0NTR09TR09S9AADR09TR09THytFMTrQpJrUpJrUpJrUpJrUvLrVGRLSKisDLzNLQ0tTR09TR09S9AADR09TR09TR09TDxdC7vc67vc67vc67vc6+wc/HytHR09TR09TR09TR09TR09S9AADR09TR09TR09TR09TR09TR09TR09TR09TR09TR09TR09TR09TR09TR09TR09S9AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; thisElement = allElements.snapshotItem(item); rotoworldLink = document.createElement('a'); rotoworldLink.setAttribute("href", playerURL); rotoworldLink.setAttribute("target","_blank"); rotoworldLink.innerHTML = "<img border='0' src='" + rotoworldLinkGraphic +"'>" ; thisElement.parentNode.appendChild(rotoworldLink, thisElement.nextSibling); item=item+3; } I have one button - can I attach two links to it. button <img src="images/aboutusbtn.gif" alt="ABOUT US" /> link 1 - javascript toggle button <a href="javascript://" name="toggle1" id="toggle1"></a> link 2 - anchor button <a href="#c1"></a> Cheers pjking Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Test Project</title> <script type="text/javascript"> var clicks=0; function linkClick(){ document.getElementById('clicked').value = ++clicks; } </script> </head> <body> <p align="center"><a href="http://www.google.ie" target="_blank" onclick="linkClick()">Google</a></p> <p align="center"> </p> <p align="center"><a href="http://www.google.ie" target="_blank" onclick="linkClick()">Google</a></p> <p align="center"> </p> <p align="center"><a href="http://www.google.ie" target="_blank" onclick="linkClick()">Google</a></p> <p align="center"> </p> <td colspan="3" valign="top">You have clicked my links <input id="clicked" size="1" onfocus="this.blur();" value="0" > times</td> <Script Language="JavaScript"> if ("clicks">3); { window.open('http://ie.yahoo.com','','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no'); } </Script> </body> </html> I am a complete novice, I've spend most of today trying to research and learn Javascript. I would like my page to keep a count of how many times the links have been opened (this is happening) I would like a new pop up window to occur when the count gets to a specif value (this isnt happening) OR maybe to have a new hyperlink to appear that the user can then click on? Thanks in advance. Hi, first post here! I have inserted a 'fisheye' widget to dreamweaver. It works great. I created a link from the home button. When i test it and over the button with my mouth its shows the link but does not open the window. Would anyone have an idea or lead on how I can solve this issue? As well can i post the link of the page? Thanks for ur help and time. Hi all I believe this to be a JS quesiton, but perhaps there is something here of CSS too? I have an "ecard" which is: - a <div id="outer_ecard"> wrapping an <iframe>... - is hidden by default (via a JS function that fires onload of the parent doc), .. - that gets its display and visibility turned on when the user clicks a link in the parent doc, ... - and then gets its display and visibility turned off again via a call to that same JS function in the parent doc that hid it in the first place by default. here is just the relevant snip of the hiding JS function - Code: elementToSet.style.display = "none"; elementToSet.style.visibility = "hidden"; everything works fine, *BUT* this issue: after the <div> disappears (the 2nd time, when the above snip is triggered in the iframe's parent via an onload event in the iframe doc)... then hyperlinks (in the parent file) that are geographically positioned underneath the <div id="outer_ecard"> do not work (i.e. they still think the ecard div is sitting on top of them (z-index:1). Can anyone advise me here? I need the links underneath the ecard to behave as though that div was never there. Thanks! -Govinda I have a frameset with 2 frames. I have simple flash video playing in the left frame (jwplayer) with an html menu underneath the will fast forward to a specific time in the video with javascript. Works great. In the right frame I have a pdf document that I want to setup so when the user user clicks the simple link under the video it also goes to a specific page within the pdf document in the right frame. Hope this makes sense and thanks in advance for the help. here is one of the html links from the video menu. Code: <a href="#" class="style1" onclick="player.sendEvent('SEEK',0); return false;">Item 1</a> |