Window.location.href Not Working In Safari When Using Onkeypress?
May 6, 2010
I'm using an asp textbox and a search button. In Safari if I click the search button i get redirected to the search results page using javascript window.location.href. But strangely the same javascript will not redirect to the page if I press return in the textbox. Using the alert function I can see that window.location.href has the the correct url and the location bar at the top changes from the search page(default.aspx) to the search results url however when I click OK to the alert box the url at the top reverts back to the default.aspx page. It works on ie7/8/firefox/chrome but not safari. Here is my javascript,cs and aspx code:
function submitSearchOnEnter(e) {
var CodeForEnter = 13;
var codeEnteredByUser;
[code]...
View 3 Replies
Similar Messages:
Apr 4, 2011
lstItems.Attributes.Add("onclick", "javascript:window.location.href='" + Project2.Constants.MySiteURL + "myPage.aspx/" + ID + "';");
edit:-
i found this solution on SO but dont know how to use it in my case :
window.open("http://asdf.com", "window_name","location=1,status=1,scrollbars=1,resizable=no,width=650,height=650");
edit 2 :-
Any Javascript expert in here ?
edit3 :-
@Headshota:: Its still opening in new tab in firefox and as apop up window in IE :(
edit 4 :-
@ Craig :: What does this mean? "possibly got a misplace target="_blank" somewhere" How do i check for it?
View 2 Replies
Mar 17, 2010
I created a search functionallity for a client site but cannot get this Enter key search to navigate to my search box. I added HTML client controls as to server controls:
[Code]....
My Javascript does fire on enter key, and it does call the "searchProducts" method but not navigating to my desired location. Here is the Javascript:
function searchKeyPress(e) {
if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
$('#go').click();
return false;
} else {
return true;
}
}
function searchProducts() {
var searchVal = $('#s').val();
var concLoc = [URL]
window.location.href = concLoc;
}
View 12 Replies
Feb 2, 2011
I am trying to open popup using window.open finction but somehow it's not working ... well below is the code
string properties = "left=250px, top=245px, width=700px, height=450px,scrollbars=yes, status=yes, resizable=yes";
TableCell cell = new TableCell();
cell.Text = "<a href="javascript:void(window.open('details.aspx?node="+node+"','"+properties+"'))">" + "View Details</a>";
But his is not working. While clicking the anchor tag getting javascript error "Invalid argument".
View 1 Replies
Nov 29, 2010
I'm having one problem in mobile website using jquery.
i have written a code on button click to redirect using window.location='test.aspx' it doesn't work event my javascript validation is also not worked. how to explain if your in other country give error 406 forbidden access is deny.
View 2 Replies
Jan 22, 2010
In some javascript, I have:var url = "find.aspx?" + "location=" + encodeURIComponent( address );
alert( url );location.href = url;where the value of address is the string "Seattle, WA".
[code]...
So I'm getting three different representations whereas I would expect that in all three places I should see what I see in the alert. My expectation is that the url I assign to location.href should show up as-is in the browser url window, and should be passed as-is to the server in Request.Url (and I would need to decode the values on the server before using them).What's happening?
View 3 Replies
Nov 19, 2010
After the implementation of ajax drag and drop, we have observed that which is working fine in IE and Firefox and not in chrome and safari, In Google chrome and Safari when we try to drag a module, the page getting scrolling to the top of the page.
View 1 Replies
Mar 2, 2010
i want to ask why the is not working within the <asp:ListItem>? and what's the solution?
View 2 Replies
Aug 13, 2010
I was going through a website I've taken over and came across this section in one of the pages:
<a href="javascript:window.location='<%=GetSignOutUrl()%>';">
// img
</a>
Apparently anyone who has ever used the site without javascript would not be able to log out properly (surprisingly enough, this has never come up).
So the first thing that comes to mind is
<a href="<%=GetSignOutUrl()" onclick="javascript:window.location='<%=GetSignOutUrl()%>';">
// img
</a>
Then I realized I don't know why I'm keeping the javascript call around at all. I'm just a little confused as to why it would have been written like that in the first place when a regular link would have worked just fine. What benefit does window.location have over just a regular link?
This is also the only place in the website I've seen something like this done (so far).
Edit: The programmer before me was highly competent, which is actually why I was wondering if there was something I wasn't taking into account or if he just made a simple oversight.
View 4 Replies
May 19, 2010
I have the following HTML with a databinding expression as shown below:
[Code]....
The 'title' tag's expression gets evaluated fine.
But not the one in 'href' attrib of the 'link' tag. The HTML source generated shows the literal text "..this.BaseURL.../..."
Any idea what could be happening?
View 3 Replies
Jan 28, 2010
have an application in which we are sending mail to client when they register for newsletter to the clients mail id.in that mail we are sending one link which sholud open in a new window on click of the link.The link is working fine in gmail and hotmail, the link is not working in yahooo web mails.
View 5 Replies
Mar 9, 2011
I want to add a version number to my js files.
<link href="css/reset.min.css?v=<%= App.Golbal.VERSION %>" media="all" rel="Stylesheet" type="text/css" />
This renders as
<link href="css/reset.min.css?v=<%= App.Golbal.VERSION %>" media="all" rel="Stylesheet" type="text/css" />
[Standard asp.net 4 web applciation]
View 4 Replies
Jul 29, 2010
Is it possible to have a server-side click handler for a hyperlink?
View 2 Replies
Aug 6, 2010
Is it possible to get window.location.hash on the server-side code alone? [URL]
View 2 Replies
Oct 8, 2010
I am using a check box to select and unselect all the rows
in a grid using the javascript. this is working fine in IE but its not working in safari
View 2 Replies
Mar 23, 2010
I am using .Net 1.1 for development of a web site. I have buttons for next and Back navigation in my user control. I have added this user control to my .aspx page. The navigation works fine in IE and FireFox, but the event does not get called for Safari and Google Chrome browsers.
View 1 Replies
May 10, 2010
I have a problem with a script for a image gallery. The problem seems to only occur on Safari and Chrome, but if I refresh the page I get it to work correctly - weird!
Correct function:The gallery has a top bar, which if you hover over it, it will display a caption. Below sits the main image. At the bottom there is another bar that is a reversal of the top bar. When you hover over it, it will display thumbnails of the gallery.
The problem:In Safari and Chrome, the thumbnail holder will not display. In fact, it doesn't even show it as an active item (or a rollover). But oddly enough, if you manually refresh the page it begins to work correctly for the rest of the time you view the page. Once you have left the page and return the same error occurs again and you have to go through the same process.
Here's one of the pages to look at:
link text
Here's the CSS:
#ThumbsGutter {
background: url(../Images/1x1.gif);
background: url(/Images/1x1.gif);[code]....
View 1 Replies
Nov 20, 2010
my website www.findmyhomefromhome.com after a sucessful entry i redirect the users to their previous uploads which is the manageaccomm page. The code behind that does this is Response.AddHeader("REFRESH", "3;URL=manageaccomm.aspx");
This works in firefox but not in safari. In safari it goes to the following [url]
and the message "resource could not be found Requested URL: /manageaccomm.aspx, 3;URL=manageaccomm.aspx".
I'd like to fix this but keep it working on other browsers .
View 4 Replies
Feb 16, 2011
I use the following code to get the file name out of the URL.
[Code]....
This works fine if there is actually a page that shows up after a '/', I would also like to check for when there is nothing showingup after the '/'. My alert above shows nothing to be there, but how do I chack for the nothing. I have tried the folloiwng, but for some resaon it just ignores me. If I do an if statement, it doesn't pick up that there isn't anything there.
if (sPage = '') { alert(sPage);}
Even though there isn't anything there, it won't show the alert and acts as if there is actually something there.
View 1 Replies
Oct 26, 2010
I have a page that creates a pdf and opens the pdf. I use response.write with javascript using window.open to make the window open with the pdf, works fine. I then want the main window to do a redirect to a message page. But soon as I add code to do that (either more javascript using location.href or response.redirect, it does that but the window.open no longer works. It's like it's running the redirect before it really has a chance to finish the window.open. Is there a better way (a way that works LOL) to accomplish this?
View 2 Replies
Feb 12, 2010
I've got a click tracking AJAX function (calls a WebMethod on an .aspx page), and I need to call it when the user clicks through to a link.Unfortunately, I'm using window.location = "newUrl" to change the page, which seems to make the AJAX call fail. Is there a way around this?I do not need to get any information back from the AJAX call, I just need to make sure the WebMethod is called'm aware that I could just redirect on the success() or failure() calls, but then I would have to wait for the clickTracking() method to run, which takes ~ 1s. That is not acceptable by the agreement in the project spec, and so is not a viable solution.
View 3 Replies
Apr 3, 2010
I've had an issue with a javascript menu not working inside an Ajax update panel after the ajax postback. I was able to solve this in IE by calling the menu js function with a pageLoad() function which is automatically called by ajax. However I then discovered it doesn't work in any other browser.
Having search around I've only found two references to the issue; one where someone else has found the same thing and another where someone states that pageLoad isn't stable in other browsers.
Is there any way to solve this issue in browsers other than IE?
View 1 Replies
May 16, 2010
I have a web page that opens another web page in a pop up window. I would like to refresh the parent page when the submit button is clicked on the pop up page. I tried using window.opener.location.reload(); in IE7 but nothing seems to be happening.
View 15 Replies
Nov 17, 2010
I am using AjaxContrToolKit (AjaxControlToolkit.Compat.DragDrop.DragDropScripts.js) in my application to provide the drag and drop facility . After implementing the same in the application , observed that working fine in IE and Firefox browser . But the same is not working in Safari and WebKit (Chrome and Safari) browser . In these browsers(both Safari and Webkit), while clicking on the top of the panel getting scrolled up .
View 1 Replies
Mar 18, 2010
I have taken menu control to display pages on my project. it is working fine in mozilla bu not in safari and internet explorer.
In safari Even sub menu items are not coming. it is displaying like this.
T-Shirts Expand <b>T-Shirts</b> Caps Expand
<b>Caps</b> Bags Expand
<b>Bags</b> Neck
Ties Expand <b>Neck Ties</b> Gift
Items Expand <b>Gift Items</b> in Safari.
In Internet explorer sub menu items are not coming.
View 2 Replies