JQuery :: Changing HRef Value For Redirection
Dec 7, 2011
I have external links on my website which are added by users of the system. I want to do the following:
1) Change the HREF value via jquery of any external hyperlink to be a page on my site that opens in a new window
2) This page will be a 'Please wait, we are redirecting you to your chosen website
' kind of page
3) This page then redirects the user to the URL they clicked after a couple of seconds
I thought of doing something like the following:
$('a[href^="http://"]').attr({target: "_blank", title: "Opens in a new window", href: "/redirect/"+$(this).href});
So the idea being that I open all external URLs in a new window but I load a page called /redirect (which is my own page) but I pass to it the URL I want to redirect too.
This is not working as each time I click my link my URL is:
/redirect/undefined
View 1 Replies
ADVERTISEMENT
Aug 28, 2010
What is a good way to switch a number at the end of a string?Im trying to change the value 0 to value 1 at the end of a URL when a button is clicked. (And vise-versa)So if I have this:<a class="important_ajax" href="projects/important_ajax/0"></a>Them the part here should be simple but im unsure of a good way to do this easily:
$(".important_ajax").click(function() {
$obj = $(this); // So I can use THIS object inside of other objects.
$url = $obj.attr('href'); // This is the URL: projects/important_ajax/0
[code]....
View 1 Replies
View Related
Sep 23, 2009
I am using an online e-commerce hosting solution and they wont let me modify certain pages because they have full control. Is there a way to do it through jQuery?
Here is the tag:
<a href="AccountSettings.asp?modwhat=change_a">Change e-mail address, or password</a>
I want to change the text "Change e-mail address, or password"
View 2 Replies
View Related
Nov 9, 2006
I want to change the href for all the <a> tags once the page has full loaded.
Is there any way to do it.
View 3 Replies
View Related
Apr 10, 2010
I need to run window.open() via href (not via onclick) as the CMS I'm working on only allows setting the href, not the whole <a> tag. I'm doing this: <a href="javascript: window.open('myUrl.php');">click this</a> and the window pops up just fine but the originating page changes to blank with '[object Window]' in it. How can I prevent the originating page from changing URL (by adding something to the javascript call)? Like "return void;" or something - but of course that didn't work...
View 2 Replies
View Related
Apr 28, 2011
I'm using a service to remotely create a pdf - it creates a pdf of the page you're on. Unfortunately that includes the link as well. I'd like to push the pdf generator to a slightly different url which would remove the offending link. The link I have is:
[Code]....
but it is not fooled! It seems I need to edit location.href but I don't know how to do it!!
View 2 Replies
View Related
Jul 12, 2010
I'm using the following code (simplified version) to call a Json file, parse it and on each iteration, create a div with an ID of "tab". I'm using this with jQuery UI .tab() to create a listing with entries which have three tabs. Anyhow, the principle seems to work except that when I examine what's happening behind the scenes using Firefox console, I see that each href in the html code produced is causing the Json function to re-fire using the href as it's url target.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
[Code].....
View 6 Replies
View Related
Feb 4, 2011
I am still experimenting but I have a href which runs a function with a delay of 1 seconds, in that time; jQuery is also playing a 1 second animation. The new page is then loaded successfully. However, when I navigate with the browser Back button, how would I make sure that the initial page is reset to it's inital state as at the moment it appears as it would after the animation (which occurs when the href is clicked) has played.
View 1 Replies
View Related
Aug 24, 2006
I have a site in Dutch and (a translation) in English, say www.dutch.nl and www.english.nl. A Dutch site, say www.fools.nl, has a link to www.english.nl. I want this to be changed into www.dutch.nl, but the site never updates. How can I inmediately redirect the visitors of www.fools.nl to www.dutch.nl, without using php.
View 2 Replies
View Related
Jul 23, 2005
I am setting up a web page to collect some data via a questionnaire.
The questionnaire part is working fine, but I need some help with one
part. I have two different versions of the questionnaire (basically
just different orders of questions) and would like the users to be
redirected to one of the two versions. The idea I had was to have a
redirection page that simply had a web page counter on it (like so many
pages have now days) and based on this counter, people would
automatically be redirected to one of the two versions of my
questionnaire. Basically, if the counter was odd, the person would be
routed to version 1 and if even, they would be routed to version 2. I
thought this would be similar to redirecting people based on the type of
browser they are using or their language settings. However, I was
recently told there is not a way to do what I proposed above. So, this
leaves me with two questions:
1. Was the advice that I received accurate in stating that having a
simple script to redirect the user based on a web page counter is not
possible?
2. If so, does anyone have some advice as to how I could go about
automatically redirecting people to one of two web pages?
View 1 Replies
View Related
Dec 15, 2001
can anyone give me a simple redirection script? something suitable for "You'll be taken to this page in 5 seconds... if not you can click on this link"
i did a search at hotscipts but turned out lots of complicated scripts...
View 5 Replies
View Related
Aug 13, 2000
Does anyone know how to make a page redirect to another page after a given time? I am using a FREE ISP so i do not have ASP etc. I only have JAVA Script and HTML.
View 7 Replies
View Related
Feb 5, 2003
I have a drop down list and i want each time i select a value to get redirected to that page.
View 1 Replies
View Related
Mar 2, 2011
I'm a non-web programmer being forced to do some web programming.
My immediate problem is that, on submission of a form, I need to be able to open a url (that I control) with the filled-in form values appended to the new url. In other words, I need to be able to do the equivalent of :
<form>
<input name="key1" type="text"/>
<input name="key2" type="text"/>
<input type="button" value="Submit" onclick="window.open('http://new.domain.com/newpage.html?key1=val1&key2=val2')"/>
</form>
I would really like to do this without server-side code.
View 2 Replies
View Related
Jan 19, 2007
My script that uses location.replace(); only makes the textarea box to redirect. I want it to redirect whole page. How do I do that?
View 8 Replies
View Related
May 8, 2007
Right now what I have is an .htaccess file which blocks users not on my ip address list. But what I really want is a filter that will gather the ip address of the viewer, compare it against the server's ip address list, and redirect the viewer to a certain other link based on the viewer's ip address.
example:
user types in www.example.com, and according to ip address, is redirected to their own personal subdomain:
192.168.0.1 > mark.example.com
192.168.0.2 > john.example.com
192.168.0.3 > jerry.example.com
192.168.0.4 > tank.example.com
127.0.0.1 > zomgpwned.example.com
...and so on and so forth. Does anyone know how to do that?
View 2 Replies
View Related
Dec 7, 2003
I need a redirection scrtipt that will work in IE, Mozilla & Netscape... The current tag that im using:
<META HTTP-EQUIV="Refresh" CONTENT="10; URL=http://www.my-site.com">
works great in IE but nothing happens in Mozilla.
View 1 Replies
View Related
Oct 25, 2001
I'm looking for a browser redirection script that will send you to another page if you're not using IE 5+ or Netscape 6. Does anyone know where I can find one?
View 24 Replies
View Related
Jan 24, 2003
I have a drop down list which contains 5 cities like NY, Paris....
When the user selects a city and press Go button i want the user to be redirected to the url of the city he selected.
View 2 Replies
View Related
Oct 21, 2010
Its like xyz.com/index.html is hosted under us and it can be edited by many people. Some spammers edit the above index.html to javascript redirect to abc.com. I want to figure out this pages in my site xyz.com .Is there any way to track the abc.com domain on unload of the page xyz.com . Please let me know if you need any more information.
View 1 Replies
View Related
Oct 28, 2010
I'm looking for a solution (without success)to a redirection problem from a Javascript function.I'm currently in test on a local network, and I have installed Apache on a workstation whose IP address is 192.168.0.3 (in fact I installed EasyPHP).From a laptop, I can connect to the Apach server without any problem and get all HTML pages (even PHP built pages) I want.My only problem is when I try to redirect an HTML page with relative URL from a javascript function. This JS function is not of my own,I just adapted it to my environment.I'm using it because I need to send information of the user screen sizes to the server. This works pretty well when I run a browser on the server. But it fails when I try from my laptop.In fact I got the message saying "It can't connect to localhost".
View 1 Replies
View Related
Jan 27, 2011
I have a javascript redirection with an alternate text for those who have javascript disabled.
It all works fine but before redirection the alternate text displays shortly. Can I prevent that?
Code:
I also tried to hide the text with an onload event, but nothing changes
View 3 Replies
View Related
Mar 10, 2011
I want to write a javascript program which will redirect the user from a welcome page to an an intro page when a cookie is found. If there are not cookies found, the welcome page is loaded but a cookie is written so that next time the user visits the page, he will be redirected to the intro page automatically.This program would allow only new visitor to view the welcome page and other visitors to skip the welcome page to be brought to the intro page right away.
window.onload = pageInit;
function pageInit(){
var visited = "";
[code]....
View 1 Replies
View Related
Jun 15, 2011
I am trying to figure out how to hide the direction page in this code:I want to hide: www.ipage.com/mail/index.bml
<INPUT TYPE="submit" NAME="Log In"
VALUE="Check Mail"
onclick="javascript:login.action='http://www.ipage.com/mail/index.bml?s=1';
[code]....
View 5 Replies
View Related
Sep 9, 2005
I have a problem with a Javascript dropdown form that is supposed to redirect users to the site that is selected. It works fine in IE, but it supposedly doesn't work in Firefox.
If anyone here can point out what is wrong with this code, I would appreciate it. Also, if there is any way to compact the code down or make it cleaner, that would also be appreciated.
<script type="text/javascript">
<!--
function goto(form) { var index=form.select.selectedIndex
if (form.select.options[index].value != "0") {
location=form.select.options[index].value;}}
//-->
</script>
<form name="nav_form">
<select name="select" size="1">
<option value="">Select a Site
<option value="http://www.sitepoint.com/" />Sitepoint
</select>
</form>
View 1 Replies
View Related
Aug 7, 2000
Does anyone know of any good perl or java scripts that allow you to redirect visitors based on their screen resolution?? Code:
View 2 Replies
View Related