Random Header Link - Adjust The Code So That The Header Also Serves As A Clickable Link
Jun 13, 2010
I am working on a website that uses a random header. I have been trying to figure out how to adjust the code so that the header also serves as a clickable link.
Here is the code that I have:
What do I need to add in order for the header to also serve as a link? I am completely new to JavaScript and I don't understand it very well.
I need to be able to add a link element to the head element through a separate file then the file containing the head element. My attempt was as follows: Code: document.getElementsByName("head").innerHtml += "<link rel="image_src" href="<?php echo $img;?>"/>";
I want only the Text to be clickable in the accordion-header. I thought the header option is the right way to do so, but it doesn't work. Instead of h3 i want only the link to be clickable: $(function() { $( "#accordion" ).accordion({header:'a'}); }); <div id="accordion"> <h3><a href="#">First header</a></h3> <div>First content</div> <h3><a href="#">Second header</a></h3> <div>Second content</div> </div>
Recently I had a piece of code injected into my wordpress blog header and the script automatically forwards visitors to other websites. I do not know who did it, as they left this piece of cryptic script on it. Can anybody decode it so I can do some investigative work to see who put it there?
I have called a table through XML with four fields. One of them is Excel file name. I like to make a clickable link with Excel file name to open it. XML code:
I have some Javascript that is selecting text from a form textarea and copying it to the clipboard: document.myForm.myTextarea.focus(); document.myForm.myTextarea.select(); document.execCommand( 'Copy' );
This works great. However there is a problem when I try to paste the text somewhere else. Assuming that the text that is being copied is a [URL], I would like it to be pasted as a link. When I grab a URL from the address bar inside a web browser and paste it somewhere ( such as an e-mail ), it automatically shows up as a clickable link. When I put a URL into my form textarea and run the javascript, it gets pasted as a plain text ( ie. not underlined and not clickable ).
Why are these two different? I've tried running a program to see what is actually copied into the clipboard and I don't see any differences. There must be something that denotes the URL copied from the address bar as a link and therefore makes it clickable when pasted. Is there a way to force this in order to make what is copied to the clipboard from my form textarea a clickable link?
I am trying to make a clickable link in JS wheres as 2 variable assigned as Image URL and Link URL. I have changed the address per forum rules, but I assure you they are valid images addresses and link addresses var _IMAGE_URL = "fakeaddress/picture.jpg"; var _LINK_URL = "fakeaddress"; var _BANNER = "<center><a href="" + _LINK_URL + ""><img src="" + _IMAGE_URL + ""></a></center>" var _POST_THIS = _BANNER
This is then called upon later through _POST_THIS, into a text box, buts its not working. However if I change this: var _BANNER = "TEST<SP>" + _LINK_URL + "<SP>TEST<SP>2<SP>" + _IMAGE_URL + "<SP>TEST<SP>3" Everything posts fine, but ofcourse just as text addresses, such as TEST fakeaddress TEST 2 fakeaddress/picture.jpg TEST 3
So my problem is in this line, trying to post as a clickable picutre, var _BANNER = "<center><a href="" + _LINK_URL + ""><img src="" + _IMAGE_URL + ""></a></center>" Kept hammering away, and the correct statement would be this var _BANNER = "<center><a<SP>href="" + _LINK_URL + ""><img<SP>src="" + _IMAGE_URL + ""></a></center>"
Any way to select a portion of text and convert it to a clickable link? I have seen examples, where the selected text is wrapped in <a> tags, however, I have yet to see an example of having the link actually be clickable. The other issue appears to be with the document.selection property that Firefox seems to not support. So a cross-browser solution would be ideal. I intend to use this with a custom toolbar/button in FCKEditor. The toolbar is in place, we just need to resolve the selected text - clickable link issue.
I need a counter that will display beside a link, with the number of times the same link has been clicked. I do not have FTP access to the site, since it is based on a CMS.
I have a problem with a random link generator within a DIV. When I try it on my desktop it works fine, but does nothing once I upload it to the website.how to explain what happens, but here is it, more or less:The website is this: http:[url]....
Via an Ajax script, http:[url]..... is loaded into DIV "menu". Here's the script:
<script type="text/javascript"> ajaxpage('menu.html', 'menu') //load "menu.html" into "menu" DIV </script>
Well, there's another load of stuff inside the <head> tag. You may see it from the main page source code.Anyway, if you go to the menu.html, the link generator will work there as it is intended; however, if you try it from the main page, it won't do anything. But people are not suppossed to go to menu.html. They are suppossed to load it from the index.html (I mean, plain http:url....)So, here's the link generator code:
--------------------------------- <script type="text/javascript"> function randomlinks(){[code].....
I believe this could be solved if I could target the generator to the whole window, 'cause maybe it's trying to open the new page inside the DIV. Well, I don't know...
when I load a new page with location.href, ie doesn't set the http referer header while firefox&mozilla does...
I tried the click() method on a hidden link, this times it works on ie, but firefox says that click is not a function
[... <a id="ref" href.......>...</a> .... document.getElementById("ref").click(); ....] Is there any method which I can set this header manualy or make ie set it properly? Or any other idea?
I need a random JS script which stores a hyperlink around a designated image.
Let's say I've got a company website which offers various products, and on the front page I want a random image to appear of one of the products. When they click on that image, they are transfered to the page for that product. This means that the link and image has to correspond.
I have a situation where I'm currently using Basic authentication (the server issues a 401, the client pops up its window, etc., etc.).
Instead of having the server send out a 401, I would like to send out my own page that would create the proper header field for all subsequent requests from that client. Can such be done with JS? Can someone point me to an example?
I do not need encoding. This is on an intranet and the authentication is being used mainly to return different information to different users as opposed to trying to keep out the "bad guys".
Is there a way to set the value of HTTP header Referrer to null or to any specified value?? I have tried doing this
document.Referrer= null
but document.Referrer is a read only property therefore the value can't be changed and a Javascript error is occuring. Any ideas on how this can be achieved.
I have 6 headers that are animated gifs. They transition, 3 of them left to right, the other 3 right to left.I would like to have them to change to next header in sequence no matter which page on my site they click.I'm not sure this can be done, but think javascript is my best bet. Can anyone point me in the right direction?
I am trying to implement the "Freeze pane" feature in javascript as it is in excel. I am almost there but am not able to get one last thing. The row header freezing is achieved first column freezing is also achieved. However, the top left column cell (which is supposed to stay frozed during both horizontal and vertical scroll) is not frozen.