Onclick And Window.location Info?
Feb 7, 2009
I am a new Javascript user and have a question i cant seem to get my teacher to explain to me (darn online classes). My problem is i am being instructed to [URL].. to the body of my file to create a link to another file. The instructions say i cant add an html a tag for the link and I'm not really sure how to make this work without it. Here is what I have so far....(note there are a bunch of other things i need to accomplish in this and i think i probably just dont have things in the right order and I'm not sure where the onclick tag needs to sit within the javascript sections)..
[Code]...
View 2 Replies
ADVERTISEMENT
Feb 14, 2010
Danged if I can find the thread, but I swear I saw a $.url() reference in here a day or two ago. It was beingutilized for parsing out the window.location or window.location.search parameters. I made a mental note because that was something I would be needing to do.
Now I can't find it, either because the search isn't finding it or I was dreaming about this function existing.
I rummaged about the API docs and didn't find it there either. Is it something provided by one of the plugins and not a function native to jQuery?
View 3 Replies
View Related
Aug 29, 2010
I was wondering if it's possible to write a script that would check a MySQL database table every 5 seconds for the word "closed." If it finds the word in the table, then it would redirect somehow to another page. how to do it without using a meta refresh?
View 3 Replies
View Related
Sep 4, 2010
Below is the code.
My function:
function swap_content(id1,id2)
{
var tmp = document.getElementById(id1).name;
var theval = document.getElementsByName('primary_propertyp_id')[0].value;
document.getElementById(id1).name =
[Code]...
This is running through a PHP loop so it's making multiple divs and links for the secondaries. I am wanting to be able to swap out any of them to make them 'primary' this works for the first click, but after the first click it makes every div id and input name the same as the first that was clicked. It's also not working AT all if i click on the bottom link first, then a link above it. Top-down works, bottom-up doesn't..
View 1 Replies
View Related
Dec 24, 2005
I am trying to open up a new window and then get the current url/location
back from the (win_1) window and display the url in an alert box.
Here is the code I am using :-
<script type="text/javascript">
var mywin_1 = open ("http://www.anysite.com/index.htm", "win_1",
"height=640, width=820, left=200, top=0, scrollbars, status, location");
var temp = mywin_1.location;
alert (temp);
</script>
Where am I going wrong?
View 2 Replies
View Related
Nov 13, 2011
I'm using window.showModalDialog but having an issue trying to set the parent window(main browser). I open modal window A which is then opens modal window B, top of modal window B onload I do window.opener.close()". My issue now is when i'm finished with B I set parent window(main browser) to a new url with window.opener.location. So my problem is modal window A the parent has been closed so window.opener.location will not work.
View 3 Replies
View Related
Jul 20, 2006
I am creating a send to a friend link on my site. The link will open a pop up window, which contains a form.
I have a function that opens the centered pop up window, and it is called like so (the function declaration resides in an external script):
Code:
onClick="newWindow('http://www.mysite.com/send.php','',âÆ',ò“','')"
I now need to append the current page's URL to the end of the URL ike so:
onClick="newWindow('http://www.mysite.com/send.php?page=xxx','',âÆ',ò“','')"
This is sso that I can then use PHP in the pop up toget the variable from the query string.
I know that I can use location.href to get the current page url, but am not sure how I would include it in the onClick.
I have tried the following:
onClick="newWindow('http://www.mysite.com/send.php?page=location.href','',âÆ',ò“','')"
but that doenst work...
Has anybody got any ideas?
View 3 Replies
View Related
Mar 18, 2009
I dont know a lot about Javascript or AJAX. But, what I am wanting to do is to have two forms and what ever is entered in either will open a new window with that info.
[URL]
In form one I want what is entered to be placed where the 77777 is in the URL in a new window.
In form two I want what is entered to replace IRN=77777 with Username=88888 and where the 88888 is will be what is entered in the field.
Here is what I have currently on my page:
Code:
<table border="0">
<tbody>
<tr>
<td>Search IRN:<br /><input name="" style="width: 200px;" type="text"></td>
[Code]....
View 3 Replies
View Related
May 28, 2007
I have the following code that I use to set the onclick function to top.location.href, but I need a way to extract the existing location.href from the onclick function, so then I can re-purpose it in the new onclick function. Any help would be greatly appreciated.
<script type="text/javascript">
var links = new Array();
links = document.getElementsByTagName("td");
for(var i=0;i<links.length;i++){
var tempfunc = links[i].onclick;
//*****EXTRACT THE URL***** NEED THIS PIECE //
var url = "http://www.sitepoint.com"; //say this is the url you extracted
links[i].onclick=function(){window.top.location.href=url};
}
</script>
View 7 Replies
View Related
Jul 23, 2005
<script language="javascript">
function ConfirmPage() {
window.location.href="http://ConfirmationPage.htm";
return false;
}
</script>
How can I use this script to display a page in my current directory? It woriks fine when using a domain such as yahoo.com or google.com.
View 3 Replies
View Related
Jul 23, 2005
i have the following script:
function subCat(){
var d = document.all;
var i = d.sid.value;
if(i != "-1"){
window.location = "subcat.php?sid="+i;
}
}
That is called on the following drop down menu:
<select name="sid" class="dropBox" id="sid" onChange="javascript:subCat()">
<option value="-1">Please Select</option>
<option value="1">category 1</option>
<option value="2">category 2</option>
<option value="3">category 3</option>
<option value="4">category 4</option>
</select>
It works fine in IE but not in Mozilla Firefox, what do i need to chnage to
make it work correctly?
View 2 Replies
View Related
Jul 23, 2005
I'm working on a page that uses javascript very much. My problem is now
that i cannot redirect to another page in IE with window.location =<URL>;
This command gets executed (proofed with alert messages) but nothing
happens. FF acts like expected but i cant get it work in IE. What can be
the problem here?
here the code i use:
this.NodeSelected = function( node ) {
if ( node.Value != null && node.Value != "" ) {
window.location = node.Value;
}
}
View 3 Replies
View Related
Jun 13, 2007
The following JS script works fine in FF and IE7. It fails though in IE6, which happens to be my target audience. Whats failing is.. the window.location is not calling.
function confirmation(text,url_link) {
var answer = confirm(text)
if (answer){
window.location = url_link;
}
}
View 2 Replies
View Related
Jan 25, 2006
I use this code to create a banner that contains text:
<table of banner...
because it makes the whole banner a link. If I do it this way:
<table><tr><td ><a href='http://URL' target='_blank'>text of banner...
only the text is the link and if someone puts their cursor over a non-text area they might no realize they can click on it.
In the second example, however, I use target='_blank' to open up a new window.
My question is, is there a way to use the first method and open a new window.
View 2 Replies
View Related
Feb 21, 2006
What is the difference between:
location.href = "http://url/"
window.location.href = "http://url/"
and
window.location = "http://url/"
??
What is the best way to direct the browser to a new page using javascript and have it work across all browsers?
View 3 Replies
View Related
Sep 26, 2009
I am doing my final year project. I am trying to access webpages via javascript. while i am doing this i open a new window to display webpages.And i have to get the url from child window while i am navigating the webpages. I have tried to get the url from child window after the new window is opened. But i get the null value as a result.[code]
View 4 Replies
View Related
Mar 17, 2003
I have a inventory control program written and I use
window.opener.location='filename.html' window.close()
It works fine in ie6 on windows 98 and XP home but sometimes for users with XP professional it crashes ie6 (wants to send a error reports to microsoft and the closes)
I was wondering if it could be that professionals "mutil" processing causing a problem by 1 process excuting before the other?
View 2 Replies
View Related
Sep 28, 2005
This may sound dumb but this is what I want and I am not sure how to frame it better. I see window.location.replace() creating problem with my "Back" browser button. This is because, location.replace() actually replaces the url in the history with the one currently given. So if I click on "Back" button after going to an url using window.location.replace, it goes to the previous-1 page.
Is there any measure to avoid this? Or do we have an alternative function that does the same action without replacing history?
View 7 Replies
View Related
Jul 23, 2005
I'm popping a window to a page with a different dns than the parent, and
i want the opener's location reloaded when this window is closed.
With Mozilla it seems that all the opener's methods and properties are
protected because the dns are different. A security exception
(permission denied) is thrown every time i try to exec an
"opener.location.reload()" from the pop up window.
An alternative would be catching the window closing from the opener, but
i don't know how this could be done.
View 2 Replies
View Related
Aug 11, 2005
why window.location.href or window.location javascript functions doesn't
work on mac browsing IE
View 1 Replies
View Related
May 23, 2006
as i know href is a property of location but location.href(url) works
fine with IE 6. i couldn't figure out how its possible? is it a kind of
browser syntax-tolerance helping it to work? how the heck is this
working?
View 8 Replies
View Related
May 17, 2007
I have a pop up window, that window needs to refresh the parent window when opened, I'm doing the following:
window.opener.location.href(window.opener.location .href);
problem I'm having is that the parent url has a # sign in it, like:
http://localhost/mysite/me.html#01
i need the #01 to stay in the url after the refresh, anyway to do
this? i tried using escape(window.opener.location.href) but that
didn't work, as it escaped everything including the :// in http://
i also tried:
window.opener.location.href(window.opener.location .protocol + "//" +
window.opener.location.hostname + window.opener.location.pathname);
problem with that was i lost the #01 in the url, pathname didn't
include it.
View 5 Replies
View Related
Jul 14, 2010
i am trying to redirect user from onchange event to another location in the page. its work fine in IE but not in firefox why window.location doesn't work in FF ?
[Code]....
View 4 Replies
View Related
Jan 3, 2011
I'm currently paying for a web service on a hosted platform. Basically, I'm unable to edit any raw content, however I am able to do things like add JS/HTML to the header or footer of a page, which will in turn be displayed on every page of this platform. My dilemma is, I only want content being showed on a single page of the platform. Specifically, I want a window.alert being displayed on the "/signup" page, but all I have to work with is JS in a global footer.Is there some way I can use window.location to achieve this?
View 1 Replies
View Related
Jul 30, 2005
I am trying to use the window.opener.location code from a link on my popup window to change the webpage in the window that opened my popup. It works on ie/firefox, but doesnt work on safari.
function changepage(id) {
window.opener.focus();
//window.opener.location('http://www.mysite.com/index.php?id='+id);
window.opener.location.pathname = 'index.php?id=' + id;
self.close();
return false;
}
Now i've tried the link with both <a href="#" changepage(35);"> and <a href="javascript:changepage(32);"> but safari doesnt want to touch the opener page. Do you know of any workaround/hack to get this to work? If not, is there a way to check to see if the user has safari and change the code to opening the page in a new window?
View 4 Replies
View Related
Apr 12, 2006
Trying to automatically redirect to a new window.
View 2 Replies
View Related