chrome safari javascript jquery back - javascript

Is there anything particular to chrome or safari that would make a javascript/jquery script work on the first page load, but then when the user hits the back button after navigating the site, it causes select boxes to be selected?
Here is the code. Apologizes before hand for the lack of conventions. I had to get this up quick:
http://www.mailcanarias.com/index.php

I believe that's because (at least Safari) auto-refills forms when you go back

Related

How can I recreate the reload issue when a button is pressed on HTML

I had an issue with my company's Web product, when a button is pressed the whole page is reloaded. This issue is similar to this one, I tried the solution and it works.
Now I need to confirm the behavior on the versions of Internet Explorer that does not run on Windows XP (but some of our clients uses). All of the PC in my office still runs Windows XP, and with strict policy there's no way I can use my home PC or laptop to access that product.
I've tried to recreate the issue by creating a small HTML codes containing a button. However the refreshing does not occur. I missed some criteria, and I don't know what it is. So I'd like ask what is required to makes it reload the page when a button is pressed. The button on the page is constructed using <button> tag.
So I'd like ask what is required to makes it reload the page when a
button is pressed
This should work in older browsers, too:
<button onclick="location.reload(true);">reload</button>

Javascript specific to Chrome

I have lots of rails and javascript code in one project. So far it works fine, but on one particular place Javascript is not working in Chrome, works in other browsers.
The form itself has a checkbox. Once it is selected it will enable textboxes on the form. On initial load, it is not enabling the fields. But as soon as I select "inspect elements" in Chrome, and close inspect elements window it starts working, javascript kicks in and works as it should.
There is so much code behind, that it would be really difficult to post it here. I am hoping there is some "magic" only specific to Chrome.
Did anyone ever had this kind of problem before?

Browser auto scrolls to form

I have designed a one-page homepage with lots of content, in which a contact form is implemented at the bottom (see http://neu.logopaedie-scheithauer.de/). Upon opening the page for the first time, most browsers (IE, FF, Safari) scroll down to the first field of the contact form, possibly due to an auto focus.
This undesired behaviour leads to a bad user experience, as the user expects to read the page from top to bottom. However, I can't figure out, how to stop it. Any ideas?
It is because of the runonload function, and just removing the code, will fix the issue. Let us know if it has fixed. Just remove this code from the file contactform.js:
runOnLoad(function(){
$("input#name").select().focus();
});

Address bar keeps popping down in mobile Safari

I am having trouble in mobile Safari. I have a link that when clicked (or tapped) fires some Javascript but does not navigate to a new page (onclick="return false"). The link is performing the way that I want but when it is tapped the address bar in mobile safari pops down for a second giving the impression that one is navigating somewhere. I need a way to prevent this behavior.
The only solution I have found is to remove the href's from the links in general via javascript.

How to prevent the 'Save (image) as' dialog on Ctrl+click in Opera

I have to create an image gallery where user can select some images and then process them. The selection should be done via Ctrl+LeftClick of the mouse. It works well in FF and IE8, but when I Ctrl+click in Opera, new dialog "Save as" appears which causes saving the clicked image.
How do I prevent opening the dialog in Opera? (it's probably system setting)
I haven't still found any solution. The question at Opera remains unanswered since June,2008 :(
Is it even possible? Ctrl+Click is standard way in OS, that's probably the problem - adapting desktop behaviour to web.
In Opera, it is possible to set this behavior in Tools->Preferences->Content->JavaScript Options->Allow script to detect context menu events. This is unchecked by default, which means that most users will see the browser's context menu.
This was added to prevent "context menu hijacking"; unfortunately, this limits all browser apps to the left mouse button. You could have the user rightclick->Edit site preferences->Scripting->Allow script to detect context menu events; this should allow your site to use this functionality.
I don't believe this is possible - I'd advise a different key mapping for Opera (or indeed all browsers)
For example, Opera has an option where the right click context menu cannot be disabled by javascript - as a protection for Opera users.
Can you make it just a click? that would toggle each picture. e.g. first click selects, then if you click it again, it deselects.
Something like this... where you can visually see what has been picked.
If you're attempting to prevent people from saving image it is pointless. All the user needs to do to get around context-menu-hijacking is disable JavaScript temporarily on that page, or press PRINT SCREEN.
This should work:
<img src="myImage.png" onclick="event.preventDefault();">

Categories