JavaScript - Use One Link Value As Another Link Value
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> Similar TutorialsI'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?
I'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> 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? 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> . 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; 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 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 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 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. 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>"), Hello! I wan't to know what is the best way for hitting a given URL whit javascript. I just need that that page hitted know that it was hitted. Tanks! Hi all, Trying to something i guess is pretty basic but i cant seem to get it working. I have a page with an iframe name="grid" and on that page i am also running a mootools script which toggles a pannel. The javascript for the pannel is: Code: <script type="text/javascript"> window.addEvent('domready', function(){ var mySlide = new Fx.Slide('top-panel'); $('toggle').addEvent('click', function(e){ e = new Event(e); mySlide.toggle(); e.stop(); }); }); </script> so this link opens the pannel Code: <a href="#" id="toggle">Show Panel</a> However, i want to make a it so that one link can both call a page in the iframe AND toggle the pannel. I tried: Code: <a href="page_to_call.htm" target="grid" id="toggle">Show panel and call page in iframe</a> but no joy. I want more than one link to be able to do this (calling different pages to the iframe and each one toggling the pannel) Can anyone help? Thanks loads in advance for any reply. Hello, I've been reading my JS book, have done a 'Degrees Converter' which converts fahrenheit into centigrade. There is a prompt box which automatically loads when the website is loaded. I am pressuming this is because I have my script in the body. I have a question if anybody could possibly help me out. How do I get my script as a link? To explain a little better, I wanted to put the words 'Degrees Converter' onto my page(as a link), so that when people click the link, it loads up the prompt box. I'm very new to JavaScript, so if anyone could help me out it would be a great help. Thank you very much. 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 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! 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? I go to a page and have this in the URL http://beta.pigskinempire.com/boxscore.asp?w=6&s=5&yr= I want to create a link on that page that when you click it it changes the URL to http://beta.pigskinempire.com/game.asp?gnum=6&gslot=5 as you can see the numbers 6 and 5 are about the only things that are similar in the substring. I will have this on multiple pages so it will be taking different numbers from the same spots of the URL and plugging them into the new URL into the correct location. Thank you very much if you can help me, I am thinking regEx will be needed but I am not very comfortable with it. Thanks again. 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. |