Manual Select To Open A Link In _blank

Aug 9, 2006

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.

View 1 Replies


ADVERTISEMENT

How To Get A Javascript Link To Open In A New Window Like Target=_blank?

Apr 12, 2007

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.

View 3 Replies View Related

Edit - Open The Links In Select To _blank Not To A New Window

Nov 1, 2010

[Code]...

And i need edit this code that it open the links in select to _blank not to a new window

View 4 Replies View Related

_blank Page Open Parent?

Jan 19, 2010

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.

View 1 Replies View Related

Open A New _blank Type Window When A User Submits

Mar 2, 2009

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!

<form name="done">
<div class="photoContainer">
<p class="process">Photos Successfully Uploaded</p>
<div class="processbtns">
<input class="button space" type="button" target="_blank" value="View Photos on ebby.com"
onclick="window.location.href = 'http://www.ebby.com/details/<?=$propid?>.html';"/>
[Code]....

View 3 Replies View Related

Resize Image Link Sent To _blank?

Aug 17, 2011

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.

View 1 Replies View Related

Open In New Browser Window (like With Target="_blank", Not Window.open)

Dec 1, 2011

Code: window.location but have it open in new browser window (like with target="_blank", not window.open)

View 7 Replies View Related

Open Links In Target-="_blank"?

Oct 30, 2010

I need to add [target="_blank"] to the code below but I can't figure it out.

[Code]..

View 3 Replies View Related

Target="_blank" Functionality - Target Page To Open It As Top Location From Within An Iframe

Mar 24, 2011

I am using the following javascript on the target page to open it as top location from within an iframe, which is working ok.

<script type="text/javascript">
if(self!=top) {
top.location.href=location.href
}
</script>

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.

View 2 Replies View Related

Turn Manual Into Automatic?

Jun 17, 2010

I have a javascript gallery code that I have downloaded for free. it is a big pic with small buttons under it

you can press one of the small buttons and the pic will chancecan I make it auto slide?

Im new to javascript so I kinda understand everything and its logic, but this is one step ahead of me I guess

View 2 Replies View Related

Javascript Running Only With Manual Intervention

Nov 15, 2006

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.

View 15 Replies View Related

Simulate A Manual Click - Not An Auto One

Sep 14, 2010

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.

View 5 Replies View Related

JQuery :: NyroModal Manual Opening A Page?

Jun 18, 2009

I have this within my page to open a page manually:

$.nyroModalManual({
url: '/thankyouPage.cfm'
});

Is there a way to pass URL parameters to the URL attribute? I tried HASH, but that didn't work.

View 1 Replies View Related

Code - Void Window.open - Link Would Open In The Same Window?

Feb 7, 2009

I have this piece of code which is opening link in new window:

How to change this code so link would open in the same window?

Probably I should change this part: javascript:void window.open

View 1 Replies View Related

Don't Want Link To Open New Tab?

May 13, 2010

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],

[code]....

View 3 Replies View Related

Open A Link On The Same Window Using Window.open Or Any Other Method?

Oct 19, 2011

How to open a link on the same window using window.open or any other method in JavaScript.

View 2 Replies View Related

Is It Possible To Have A Link In FF And Force It To Open In IE Or IE-tab?

Oct 18, 2007

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.

View 2 Replies View Related

Open Link In Same Window ?

Feb 7, 2009

I have this piece of code which is opening link in new window:

How to change this code so link would open in the same window?

Probably I should change this part: javascript:void window.open

View 2 Replies View Related

Open 1 Link With 2 Click?

Feb 17, 2009

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

View 2 Replies View Related

Open A Link Within An IFrame?

Sep 19, 2009

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.

View 1 Replies View Related

Open Link In New Window

Aug 29, 2004

the idea below is based on the Sitepoint's article about New-Window Links in a Standards-Compliant World

The idea is not to use the rel attribute but rather check if the domain is different from the one to which the page belongs. Code:

View 2 Replies View Related

Open Link In New Window?

Sep 6, 2010

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

View 1 Replies View Related

How To Open Link Page Using IE

Jul 28, 2010

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>

View 3 Replies View Related

Javascript 'target=_blank'

Jul 20, 2005

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:

<param name="url" valuetype="ref" value="http://www.mywebsite.com">

anyone have know what script text i put in to get hte page to open in a NEW
window similiar to the html [target="_blank"]

View 2 Replies View Related

Javascript Open Link In Same Window

Jul 23, 2005

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:

function pass_info() {

var info = "";

info += document.form2.productWeight.value;
window.open("/page/shippingrates/calculate_shipping_before.asp"
+ "?" + "weight=" + info,");
}

I know that it is the window.open, but I have not figured out what I
need to do to get it in the same window.

View 5 Replies View Related

JQuery :: Open Link In New Tab With .click?

Jan 12, 2011

I have the following:

$(".buy_icon").click(function () {
window.location = "http://www.theuntappedsource.com/results.php?category=422"
});

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.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved