Strange Thing Happening With Onunload And Google
Jul 23, 2005
I have set up a disclaimer page for our public access PCs at our Libraries which has the following function:
function breach() {
alert("Proceeding beyond these Conditions is..................... If you have read the Conditions, scroll to the bottom and press the 'Yes I
agree' button.")
window.location="disclaim.htm"
and then in the body tag I have onunload=breach()
This works fine for all websites entered into the address bar except if
you enter www.google.com
What it is supposed to do is bring up the prompt and when you click on the OK button it will go back to the disclaimer page. They should only be able to get to the web by clicking on the 'Yes I
agree' button at the bottom of the disclaimer page. Does anyone out there know why google doesn't fire up the disclaim.htm page like all the other sites? It is very frustrating.
View 1 Replies
ADVERTISEMENT
Mar 28, 2009
So I have a nice little hand rolled Ajax call to my server pulling a list from the database and displaying it in a drop down list dependant on the user input. Aka Google suggest. I am wondering if the quickest way to do this is to call the database each time with Ajax and search the results with the input, or to write an xml from the database and search that. Then when the Database is updated rewrite the xml file.
Am I underestimating MYSQL again? Or not, and I feel it would be good practice to write the xml file because it will essentially mean a lot less database calls. But I don�t know how fast searching an xml file would be in comparison to a db call. The results from the database are say 500 entries anywhere between 10 - 100 characters each. I want to know A. The best way to do this B. Lets say the site will have pretty high traffic so I am looking for it to be as tweeked as possible. I can test but thought at the end of my week it was worth seeing what peoples advice is.
View 4 Replies
View Related
Aug 6, 2010
jQuery('div#primary').attr('width', '300'); I am manipulating html file. I am doing the above. But It is not updating the html file with the new width.
View 2 Replies
View Related
Jul 11, 2011
I want to make a kind of slideshow with picture and text.The script at this moment:
$(document).ready(function () {
$("#BildLeiste0").show(2000).delay(8000).hide(2000);
$("#BildLeiste1").show(2000).delay(8000).hide(2000);
If I run the site, both animations run at the same time. I would like to achieve, that the animation atBildLeiste0 runs first and after it is completed the animationtBildLeiste1should start.If this runs the way I want, I want to make the script flexible from 2 two 6 animations and finally generate it so that it runs in an infinite loop.This is one of the first jquery-codes
View 2 Replies
View Related
May 31, 2007
I've been working on a multi-level drop down menu. It is already finished but while making it I encountered a problem that I'd like to find a solution for.
In the code, I clearly seperated the Model, View and Controller parts. The View part basically works with a single redraw-function. It clears the HTML of the complete drop-down menu and redraws it by recreating the needed DIV elements and adding them back to the webpage. The Controller part is a simple state machine that has transitions on onmouseover, onmouseout and onclick events.
In practice, when the mouse was moved over or out of some menuitem, the menu would be redrawn. The redraw function would first remove the complete menu from the HTML dom, and then re-insert the elements of the changed menu. Each of these elements contains a onmouseover and onmouseout argument.
The problem is as follows: in every redraw, when the menu is removed a onmouseout event is triggered, and when the menu is re-created a onmouseover event (in FFox). In IE, for some reason only a onmouseout event is triggered. This made my state machine think that the user actually moved the mouse pointer out of the menu element. Therefore the menu would go bananas and collapse!
The best way to solve this seems to simply ignore all of the user inputs during the redraw funtion for, say, 5 milliseconds during the redraw. However, in pratice, when the user moves the mouse very quickly the state machine 'misses' a mouseout event and the menu doesn't disappear as it should.
My question now is: does anybody know a neat way to prevent these 'ghost' events from happening while rebuilding the page, without interfering with the 'real' events?
View 1 Replies
View Related
Nov 2, 2006
I have read all the reason why DOM purists don't like document.write
and innerHTML. I would like to be a good programmer and do the right
thing and not use them. But I need your help to get it to what the
project needs done.
In the interest of brevity, the following code has been simplified.
You'll notice sDoc contains HTML and JavaScript, this is a
unchangeable requirement. PLEASE don't waste your time or mine by
explaining how un-couth it is. I know it is but there's nothing I can
do about. Answers strictly focused what can be done versus what should
be done will be greatly appreciated.
There are three attempted methods to render the sDoc. The first one is
to create a textNode and append it to a div. It prints the code as
text instead of rendering it, as expected. Is it possible to get it to
render?
The second method uses innerHTML and the HTML is rendered but not the
JavasScript.
The third method uses document.write which renders both the HTML and
JavaScript, but we really really don't want to use the write method,
but at this point it looks like we have no choice.
We've even tried to render sDoc in a DOM created iFrame, but it chokes
in Mozilla browsers because of the known bug of included scripts that
use document.write (once again another requirement that can't be
changed) kills the page as document.close fails.
<div id="foo1" style="border:1px solid black;"></div>
<div id="foo2" style="border:1px solid black;"></div>
<script type="text/javascript">
var sDoc = '<center><scr'+'ipt
language=javascript>alert(true);</scr'+'ipt></center>'
var myText = document.createTextNode(sDoc);
document.getElementById("foo1").appendChild(myText);
document.getElementById("foo2").innerHTML = sDoc;
document.write(sDoc);
</script>
Thank you for your consideration.
View 17 Replies
View Related
Aug 16, 2010
I have a text box where a user can press enter, tab (keypress) or click out of it (focusout) and an action happens. The box then gets removed. The problem is, the user presses enter, but that event is fired and then as the text box is removed the focus out is firing again.
How do I prevent removing the text box from firing the focusout action? I can remove the action totally but the text box could be returned to the document later.
View 3 Replies
View Related
Jun 2, 2011
I'm trying to echo a php variable to my javascript function but nothing is happening.Basically this php page displays bunch of records with a radio button next to each record. So when the radio button is clicked it would open that record in a new window that is clicked.
<input type='radio' name='option' value='$ctr' id='$ctr' onClick="edit_record('<?php echo $ctr ?>')">
<script type="text/javascript">
function edit_record(){[code]....
View 2 Replies
View Related
Jan 27, 2010
I have a big dropdown box with lots of items in it. It takes about 5 seconds to load in IE6. How can I use jQuery to load rest of the page, and then load the dropdown last? Right now, the dropdown load freezes the entire page until it loads.
View 3 Replies
View Related
Jul 5, 2011
I have a problem that suprisingly (not) only affects IE.
I have a hover/mouseover event when a users cursor enters a div, but because there is text inside my div IE is replaying the event if I hover in/out of the area that has text even though it is in the same div.
This is what I have:
Code:
$('.reason-1').mouseover(function(){
$('#first-r').stop(true, true).fadeIn(600);
$('#first-r-info').stop(true, true).delay(400).fadeIn(800);
[Code].....
how can I stop IE playing the action again if the user is still inside the same list element?
View 2 Replies
View Related
Feb 17, 2011
it seems like an amazing tool once I figure out what I'm doing wrong. I'm using the awesome datePicker plugin, but am just not getting something right. I can't seem to be able to get datepicker to do more than one thing.To help myself figure out what Im doing wrong, I created a very simple example:
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/base/jquery-ui.css" type="text/css" media="all" />
[code]....
View 2 Replies
View Related
May 24, 2011
Under PHP control, I am loading an <img> tag with one thing or another. I'm trying to work my way towards not changing the actual tag beyond what is already there (don't mess with the HTML).
The HTML is:
Code:
I am switching the image src path to something totally different. A such, I need to have the browser remove the alt and title attributes. I do this by loading the following in the {SRC} placeholder:
Code:
Using FF2.0.0.20, View Generated Output, I see that these attributes are indeed gone. Yet, the browser still shows (definitely) the alt attribute and (probably) the other attributes as well. I have also confirmed this happens with FF4.0.1-Portable.
View 6 Replies
View Related
Jun 29, 2011
creating a function which does the same thing for the chosen elements.I have #design1 #design1servicetext and #design1servicebutton.
//Service hover//
$('#design1').mouseenter(function (){
$('#design1servicetext').css('background-position', '0 -91px')[code]....
How can I create a function, in which I have to choose 3 divs to do the animation?
A function like ,animatebg('#design1','#design1servicetext','#design1servicebutton');
View 1 Replies
View Related
Sep 3, 2010
I've got the below function that works perfectly fine in FF, but it acts like nothing is happening in IE 8. I've tried the no cache option, my own url random addition and numerous variations.
View 2 Replies
View Related
Jul 15, 2009
basically i have this menu system which works using a couple of jquery scripts it all works fine etc, but now i am porting my site into a joomla design ( dont ask why just a challange )at the moment i have a module on the left which has my menu in and on the right is another module which loads the content depending on the outcome of the script:at the moment what ihave done is not the finished product as i would like to make sure that this will work before moving to the next part of my scriptbefore i go on and on and on ill show you what i have:
$(document).ready(function(){
$('ul.submenu>li a').click(function() {
$("div#defaultStuff").fadeOut("slow");
[code]....
View 1 Replies
View Related
Nov 5, 2011
So I am working on a project to take an integer that the user gives, and then get all the squares and cubes of all the numbers before that to the number given. It displays it in a text area. Maybe I am just lost for the moment, but It just prints the number that I give with the square root and cube instead of starting from 1, and ended on the integer I give.
[Code]...
View 3 Replies
View Related
Aug 10, 2007
I'm trying to implement an exit pop up message when a visitor leaves the site. I'm using the "onunload" event handler. In FF, it works fine. The message appears. But in IE, the pop up only appears when I do a hard (shift+refresh) refresh.
Any ideas why IE is acting differently?
View 2 Replies
View Related
Oct 5, 2009
how to use the autocomplete jQuery plugin best to my needs. I'm looking to replace a select box with the Autocomplete plugin, but not quite sure how to accomplish this. In my select box, I have the option that is displayed is not the same as the data that is submitted.
ex: <option value="123">This is Displayed </option> However, with the autocomplete, since it is using a textbox, the values that are displayed, are submitted. Do I have to hack around using hidden fields to accomplish this type of behaviour?
View 1 Replies
View Related
Dec 21, 2010
If you've seen from my previous posts in this forum, you may have noticed that i'm a newbie when it comes to javascript, anyway. I'm trying to create an array sort of thing to convert the country name's to continent, and set it as a cookie. I spent all that time writing a PHP script for this same thing only to find out that my webhost does not have the maxmind apache module. I also don't know how to get the value of the country from a javascript function.
PHP Code:
function country_to_continent( $country ){$continent = '';if( $country== 'AF' ) $continent ='AS'; --CUT OFF DUE TO TEXT LIMIT, FIND THE FULL CODE HERE: http://infinitymedia.pastebin.com/7WWDeyVT return $continent;}
[Code]...
View 9 Replies
View Related
Jul 23, 2005
I am trying to use the onunload event to know when the user closes a
popup by receiving a request on the web server.
I have a main page from where the user opens a popup. What I want is
when the user closes the popup, it sends a request to my web server
(GoAhead) using the onunload event, then closes the popup.
For the moment, this what i have: when the user closes the popup, I
use the onunload event to open a different popup (by this way, I get a
request on the web server and I know that the user closes the first
popup), then, this new popup closes itself with the onload event. It
is working but having this second popup opening and closing is not
very neat.
If I try to change the location of the first popup in the onunload
event: onunload="document.location='....'", it doesn't send a request
to the web server when the user closes the popup.
Is there a way to send a request to the webserver when the user closes
the popup without the need to have an extra popup opened and closed ?
The web server I am using is working on a pseudo "cgi" mode called
"goforms", it avoids to create a different process for each request.
With "goforms", each request is handled by a unique process which is
always running.
View 3 Replies
View Related
Jul 23, 2005
I have an onunload event in the body tag. When it is activated I want to
know if a <a></a> href was clicked and which one. Is there some document
property or any other object available for such a thing?
View 5 Replies
View Related
Jul 23, 2005
Is there anyway to display a confirm msg onUnload of a page?
I mean to say if iam calling onUnload=javascript:check();
and in check(){
if(confirm("check?"))
{
unload the page;
}
else
{
Dont unload , just come back to the previous state( i have some
values in text fields to be retained)
}
}
I want to call this function on Unload.
View 3 Replies
View Related
Jun 7, 2006
I'm using IE6 and I've just created a simple page with this event:
<body onunload="alert('sad')">
could someone tell me if this works for you if you have IE 6? I've
tested this in firefox and IE 7 and they both work fine with it. but on
the IE6 copy I'm testing, the event is fired only when the page is
refreshed. It's not fired when I close the page...
View 1 Replies
View Related
May 13, 2003
I was trying to combine PHP & JavaScript to acheive on task:
I was trying to use javascript function to perform an PHP code, but the onUnLoad function seems to perform that query when the visitors reloads the page?
I want the PHP code to execute when the user EXITS the page.
javacript code....
<body onunLoad="doExit();">
Can anyone give me a function name or how can I make that work with onUnLoad?
View 2 Replies
View Related
Jul 20, 2005
I'm working on an asp.net site and am trying to implement a popup help
window. I want the window to close when the user advances to the next page
in our application. The thing is, I'm doing this on a component basis and I
don't have access to the body tag from within my help component, so I can't
add the onunload tag. Is there some other way of achieving what I want? Can
I add an eventhandler to the body tag through javascript?
View 2 Replies
View Related
Jul 20, 2005
I would like to ignore onUnload action when the user reloads the page!!
View 6 Replies
View Related