JavaScript - Embed A Return Link In A Link?
I'm working on a technical document that has a glossary section. When I use a technical term, I link to its definition in the glossary then provide a return link to return the user to whence they came. But if I use that same term again, and if I want to link it to the glossary, I need to duplicate the glossary entry in order to provide a return link that returns them to the right place. Is there some way I could link them to the glossary and embed a unique return link in the link to the glossary?
Similar TutorialsI've been using this slidehsow but each time I click on a link (Newsflash) it goes to yahoo.com, even though each link goes to a different website, it looks like the last link of the last slidehsow is the one which controls all the slidehsow links link of slidshow as you can see from the code each link for each slidehsow should go to a diffrent website. Code: <div class="lof-main-outer"> <ul class="lof-main-wapper"> <li> <img src="images/791902news3.jpg" title="Newsflash 2" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 2" href="http://www.google.com">Newsflash 2</a></h3> <p>The one thing about a Web site, it always changes! Joomla! makes it easy to add Articles, content,...</p> </div> </li> <li> <img src="images/435576news10.jpg" title="Newsflash 1" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 1" href="http://www.gmx.com">Newsflash 1</a></h3> <p>Joomla! makes it easy to launch a Web site of any kind. Whether you want a brochure site or you are...</p> </div> </li> <li> <img src="images/641906img1.jpg" title="Newsflash 3" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 3" href="www.godaddy.com">Newsflash 3</a></h3> <p>With a library of thousands of free Extensions, you can add what you need as your site grows. Don't...</p> </div> </li> <li> <img src="images/416719news7.jpg" title="Newsflash 5" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 5" href="http://www.flickr.com">Newsflash 5</a></h3> <p>Joomla! 1.5 - 'Experience the Freedom'!. It has never been easier to create your own dynamic Web...</p> </div> </li> <li> <img src="images/416719news7.jpg" title="Newsflash 5" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 5" href="http://www.intel.com">Newsflash 5</a></h3> <p>Joomla! 1.5 - 'Experience the Freedom'!. It has never been easier to create your own dynamic Web...</p> </div> </li> <li> <img src="images/416719news7.jpg" title="Newsflash 5" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 5" href="http://www.yahoo.com">Newsflash 5</a></h3> <p>Joomla! 1.5 - 'Experience the Freedom'!. It has never been easier to create your own dynamic Web...</p> </div> </li> </ul> </div> I don't understand the logic of Break, Return False, Return True. It was never really covered in our college class, and I see everyone using it. I got an A in the class, if that 'proves' that I really tried to apply myself. NOTE: I understand what the function is doing. I just don't understand WHEN to use break, return false or return true if the the translator can determine the conditional statements. PHP Code: function submitForm(){ var ageSelected = false; for (var i=0; i<5; ++1){ if (document.forms[0].ageGroup[i].checked == true) { ageSelected = true; break; } } if (ageSelected == false){ window.alert("You must select your age group"); return false; } else return false; } if the the translator can determine the conditional statements, why not write it like this: PHP Code: function submitForm(){ var ageSelected = false; for (var i=0; i<5; ++1){ if (document.forms[0].ageGroup[i].checked == true) { ageSelected = true; break; // what's the point for the 'break'? Won't the rest of the code be ignored since it passed the first condition? } } if (ageSelected == false){ window.alert("You must select your age group"); return false; } // why not leave the last else out? is it just a 'safety' catch, in case something other than true or false is inputted? else return false; // what's the point? } Questions: Why use return true, if the translator knows it's ture? Why use "return false" if the translator knows it's false and the alert window has already gone up? why not use "break" to stop the code? Why use the "return false" at the end "else" statement? Hi, I have a flash code, I need to add alink in this code, but I don't know how I can. This is the link I want to add " www.baligim.com" Thanks. Code: Code: <div id="wb_Flash1" style="margin:0;padding:0;position:absolute;width:300px;height:60px;text-align:left;z-index:0;"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" <param name="movie" value="http://www.baligim.com/download/reklam-banner.swf"> <embed src="http://www.baligim.com/download/reklam-banner.swf" width="300" height="60"> </embed> </object></div> . Hello and good morning... I am a locking for a script, so i can open this: <div class="topprofile"><a href="index.php?side=editprofile#editpw">Edit password</div> After i have push in this, "topprofile" button, i want to have link like this: http://localhost/index.php?side=editprofile#editpw Can you plaese help me with this one? I know you may think... why is he doing this? There is a reason, this is just the simplified version. Code: <a href="URL TO COPY" id="COPYME">Next</a> <a href="COPIED URL HERE VIA JAVASCRIPT" >Next</a> Hello, im a noob when it comes to this. But what Im trying to do is this. I have a members site im trying to start up, I can get my D link, server cam to inbed on the page but it requires a admin/ pw log in. Is there a way I can have a page to auto authenticate the camera so the viewers dont have to log onto the camera, the most obvious reason is that i dont want to give out the cameras admin log in info. Thanks in advance. I once bought some plans on the net and was sent a link that said I could open so many times or for 1 week, I cant remember exactly. But now I am doing a web site and need a link like that any ideas. I would prefer it to open only so many times.
I can't figure out why this isn't working. I'm calling a function from a link in an iFrame, but I want a second function (which builds upon the first) to be called a second after the first one. So I have this: <a href="javascriptarent.func1();setTimeout('parent.func2', 1000)">Click here</a> setTimeout works when it's the only function I'm calling, but it appears that having the two together erases the delayed function. Thoughts? ~gyz Does anyone know of a safe mailto link using JavaScript?
Hi all, I am new to this forum so hope this is the right place to post my question. I'm learning how to create JavaScript menus and using online generators and tutorials, I was able to get the following working. What I can't figure out, is how I can add link to the items. For example, I want to be able to click on the sub-menu and it takes me to test.html Would someone please help me please? Thanks in advance. Edit - Code removed I have the following codes and it seems to work well but when exiting the site and re-entering it resets the values to 0 again. I am not sure how to proceed with this, been considering cookies but what if the user clears there cookies, I then looked at PHP but not understanding that to well at this stage. Javascript Code: // Function to count clicks on links var clicks1 = 0; var clicks2 = 0; var clicks3 = 0; var clicks4 = 0; function link1(){ document.getElementById('clicked1').value = ++clicks1; } function link2(){ document.getElementById('clicked2').value = ++clicks2; } function link3(){ document.getElementById('clicked3').value = ++clicks3; } function link4(){ document.getElementById('clicked4').value = ++clicks4; } HTML Code: Code: <tr valign="middle" align="center"><td colspan="1"><a target="_blank" href="http://mistiquestormelectronics.webs.com/" onclick="link1()"><img src="site_graphics/reinet.jpg" alt="Mistique Storm" width="120" height="90" /></a></td> <td colspan="2" align="left"><p>For all your Electronic equipment needs.</p></td> <td colspan="1" width="8%"><input id="clicked1" style="color: #000000; font-weight:bold; border-style: none; font-family: arial; background-color: #00FF00; text-align: center;" readonly="readonly" size="10" onfocus="this.blur();" value="0" ></td></tr> Any ideas, suggestions. Please Help? How can I let link page open using IE? for example, I open a webpage using firefox or chrome/opera/safari. when I click the link, open the link using IE <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head2" runat="server"> </head> <body> <a href="#" onClick="window.showModalDialog ('http://www.google.ca','','width=600,height=600','screenx=200','screeny=200')"><img src="images/benemanc-01th.jpg" alt="img-01" width="125" height="155" class="thumb" style="display:inline"></a> </body> </html> Many thanks T First of all I'd like to take the time to thank anyone who can assist me with this dilemma..... On the page I am designing I have 2 js slideshows. The first one slides images right to left and the second contains the caption for the image and fades in and out. Here is an example of the exact concept of what I'm trying to do: http://designsensory.com/ The problem I'm having is that the slides will not maintain the same timing and I'm not sure how to create a single user control that controls both slideshows simultaneously. I would really appreciate if someone could help me solve the issue or at least point me in the right direction (tutorials possibly?). Here is the JS code: Code: <script type="text/javascript"> var firstreel=new reelslideshow({ wrapperid: "myreel", //ID of blank DIV on page to house Slideshow dimensions: [500, 300], //width/height of gallery in pixels. Should reflect dimensions of largest image imagearray: [ ["css/500_300/Dairy plant.jpg"], //["image_path", "optional_link", "optional_target"] ["css/500_300/slider-big.jpg", "http://en.wikipedia.org/wiki/Cave", "_new"], ["css/500_300/Hospital image.jpg"], ["css/500_300/Picture2.jpg"] //<--no trailing comma after very last image element! ], displaymode: {type:'auto', pause:3500, cycles:0, pauseonmouseover:false}, orientation: "h", //Valid values: "h" or "v" persist: true, //remember last viewed slide and recall within same session? slideduration: 800 //transition duration (milliseconds) }) </script> <script type="text/javascript"> var mygallery=new fadeSlideShow({ wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow dimensions: [280, 300], //width/height of gallery in pixels. Should reflect dimensions of largest image imagearray: [ ["css/images/Test1.png", "", "", ""], ["css/images/Test2.png", "", "_new", ""], ["css/images/Test3.png"], ["css/images/Test4.png", "", "", ""] //<--no trailing comma after very last image element! ], displaymode: {type:'auto', pause:3500, cycles:0, wraparound:false, pauseonmouseover:false}, persist: false, //remember last viewed slide and recall within same session? fadeduration: 800, //transition duration (milliseconds) descreveal: "ondemand", togglerid: "" }) </script> Once again, Thanks alot for any assistance I have the following table row printing on a webpage PHP Code: echo "<tr><td id='counter1'>{$row['counter1']}</td><td><input type='button' name='counter1' onclick='submit();'</td></tr>"; While counter1 is 0, 0 is displayed in the cell. When the user clicks the button, the users username is written to a txt file and counter1 value is increased. What I'm trying to do is display the new counter value but as a link to the txt file like this <a href='path/to/txt/file.txt'>{$row['counter1']}</a> After creating the link, how do I put the link into the cell? Appreciate any help with this. Below is a bulleted array, as you can see I inserted the sample url tag but it's not working, is that the wrong location? Code: $catArr = array( 0=>array("category"=>"Banners", "id"=>217, "nav1"=>"Events & Themes", "nav2"=>"", "headerText"=>"<h2>Templates for Full Color Banners</h2><ul><li>Choose your Banner by Event or Theme</li><li>Select a template and make it your own!</li><li>Text Position and Color are for demonstration only.<br/>You may move or change them as needed.</li><br><br> 'url'=>"http://www.google.com", back to main banner page</ul>"), All, If I want to do the following: Code: result="<h2><strong>Home</strong></h2>The site idea is pretty simple. There are creeps everywhere and we want to point them out. Killing time during work or school never hurt anyone either. Help us out and give your friends something to enjoy. Make sure to submit your <a href="testurl.html">Test</a>"; How can I escape the URL because after that I want to do: Code: document.getElementById('showdata').innerHTML = result; Code: search = "#search=%22" + search + "%22"; globalHTML="<html><head><title>" + formTitle + "</title></head>"+"<frameset><frame src='" + pdfURL + search + "'></frame>"+"</frameset></html>"; This works just fine as my javascript to make a link to a pdf and bring up a search pane in the certain pdf. My question is if anyone has tried to highlight search terms in a pdf just by clicking on the link. I can't seem to get that to happen. All, I have a page that has some checkboxes in it. I have the following function for that: Code: function checkbeforesubmit(field) { for (var i = 0; i < field.length; i++){ if(field[i].checked){ // if a field is checked form is submitted alert("You have checkboxes that are selected. Add the photos before you go to the next set of pictures!"); return false; } } return true; // if no fields are checked form not submitted } I then a link to go to the next page and I want to check to see if any checkboxes are selected before I go to the next page. I try and check this by doing this: Code: onClick="checkbeforesubmit(document.photos.elements['picbigid[]'])" It does the check and says that a checkbox is selected but will still go to the next page anyway. How can I stop it from going to the next page? Thanks! |