If you have one or several links on your webpage, it could be your links resources, you might want your viewers to have the choice of opening the links in _self or in a new window / tab _blank
This service can be provided by a simple JavaScript function:
This code goes in the head section:
<SCRIPT LANGUAGE="JavaScript">
<!--
function mylink(target)
{
if (target) where = "_blank";
else where = "_self";
for (var i=0; i<=(document.links.length-1); i++)
{
document.links[i].target = where;
}
}
// -->
</SCRIPT>
And this code goes in your Body section:
<form>
<input type="checkbox" name="targetnew" onclick="mylink(this.checked)">
<p>Do you want to open this link in a new window?</p>
<p><a href="http://www.codingforums.com">CodingForums</a></p>
</form>
You can add as many link in the form section as you like and choose if each link should have a checkbox or just one checkbox the decides all the targets.
Code: <a href="#" onclick="window.location='http://YourSite.com'">click here</a> I want to make it so that it opens a new normal browser window just like target=_blank does.
I have a page that open a new window witn _blank target.At this page I want to reload the parent window or even better to reload a div with ajax.I tried this window.opener.reload() but did not work.
I need to find a way to open a new _blank type window when a user submits. I have found a few answers but none that fit what i need. alot tell you to use target blank on submit, but i have two buttons that do 2 completely different things. Is there a way to achieve that? here is the code i use!
I have a situation where I'm sending full sizes images to new windows from linked thumnails. Using _blank, the window is rendering at a very small size, and the image scales to that size on some browsers.
I want the window to be larger when it comes up, and the image to display maximized (not scaled). I know how to resize the window from javascript in link-side docs, but not in linking-side docs.and no idea how to max the presentation of the image.
However my problem occurs when the user uses the browsers back arrow to return to the previous page, the script executes again returning them once more to the page they have come from. Is anyone aware of a work around to this problem as it would seem there isn't one? perhaps even a better solution for opening the target page from the iframe as top location. This is really causing confusion for users, and I really need to get the issue fixed.
I have put some javascript into my html page (using IE6 as browser), however I get the message: "To help protect your security, Internet Explorer has restricted this file from showing active content that could access your computer. Click here for options...." Once I have selected that and specified to allow for blocked content ... the javascript runs ok. However I do not have the same problem with loading other webpages (also containing javascript) from the internet!! Does anyone have any ideas?
Another problem I have is that I have opened a popup window, which has a stylesheet linked to it. However it does not seem to know about the stylesheet as my text fonts/ styles are not displayed.
After all, there is some difference in the way we 'click' using our mouse at some place in the document, and what can be achieved by the dispatchEvent "click" in Firefox. We have a page, which has two iFrames on whole. Left frame having a table of clickable email subjects, and right frame showing the entire body of the selected email. The problem is, the clickable area on the subject is too small, making it a pain to click each email to see its body. So I implemented a way of navigating through them using keyboard in the parent page(using key handlers in Javascript). The problem is, when we load the page for first, the navigation works fine, since the focus is on the parent page. But as soon as someone clicks on any area on the two iFrames, the key handlers don't work because they are in the parent page, not in that frame.
I noticed that when I click on any area outside the two frames, it works again. Idea : "Why not do a setTimeOut or setInterval sort of thing, which just sits and keeps on clicking on a place outside the frames"? Good idea, but doesn't work. Why? Is installing the same kind of key handlers in both the frames the only other way? Even setting focus on an element on the parent page doesn't work.
i'm running a slideshow and the first image is a link, but when i click on it, it opens the page in another tab.i want it to use the same window i'm already in and open the link there.
var mygallery=new fadeSlideShow({ wrapperid: "fadeshow1", dimensions: [930, 68],
At my job we have computers that are set up with restricted rights. Firefox 2 is the default browser (good call), but for some reason a site that the user has to visit is IE only (yeah, wtf).
We have a webpage open with a link to that IE only site, now is there a way to open that link in IE from FF? We have full control over these machines, so we could install batch software or whatever it would take.
I want to make one link and If I click twice him (how to open in desktop my computer or my documents) do something and if i click him once do other something
I don't know anything about JavaScript but I found a really cool snippet I use a lot. It will randomize images and each image can open a new link. It looks like this [code]...
Now, my question is, can I link to open a document within an iFrame on my page?
Please don't tell me not to use iframes or whatever, I'm not a professional, just want to see if this works.
how to make a code like this website (Samsung P1000 Galaxy Tab images ) there you can see the images when you click the image then the browser will open a new page, and when you click the image again the browser will close
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="[URL]"> <head id="Head2" runat="server"> </head><body> <a href="#" onClick="window.showModalDialog ('[URL]','','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>
i am doing an fprotate.class pictures and for the click link i'm trying to get it to open in a new window. here's my command line and it opens in the exisiting window:
I have a form that I would like to get the values entered on the page and go to a new page in the same window. I can make the code work to open a new window, but I need it to open in the same window. Here is what I have:
Which opens the url in the current window when the icon is clicked.How would I open the url in a new tab?I should mention that I can't simply use an anchor tag.