JavaScript - Javascript Event That Refreshes Iframe- Too Much Refreshing!
Sorry for the title- i'm doing my best to describe my problem. So this is basically it:
I have some javascript onmouseover events that change the content of an iframe. The problem is that within the javascript calls, I have some url's attached to rollover buttons INSIDE the parent div's that are being manipulated by javascript. So the iframe refreshes properly when its supposed to, but it ALSO refreshes as each of the links inside the effected div are rolled over as well. So there is too much extra refreshing and lots of clicking noises because of the Internet Explorer default noise settings. The easiest way to see what im talking about is to go to: http://maybetheworldisending.com/fre...HOMEPAGE_jan4/ An example of the problematic code is as follows: Code: <div class="beachcomberoff" target="mainbox" onmouseover="ShowPage('frame1_slider');this.className='beachcomberon'" onmouseout="this.className='beachcomberoff';"> <div id="turquoise1"><a href="#"></a></div><div id="coral1"><a href="#"></a></div><img src="HOMEPAGE_jan4_web/beachcomber.png" width="453" height="330" border="0"></div> The prob is that the div's named turquoise1 and coral1 are being effected by the javascript on the containing div. How do i make it unaffected by that js? Is there something like a "onmouseover=do nothing" or something of the sort? Similar Tutorialshi there. i have a classic asp page that is using the winhttprequest object to get the contents of website from a different server. Then i modify the html i get to suit my needs.. save it to a file, and then finally, i display this stuff in an IFRAME. (i wrapped a div tag around the iframe so technically, i'm doing something like: "divtabframe.innerHTML = '<IFRAME SRC='myserver/somepage.html'></IFRAME>) My problem is that when i refresh the main page, i want the iframe to also display the latest data. It does get the latest data from the external site and its saved in "somepage.html". But the iframe isn't updated unless i explicitly right-click inside the frame and manually select refresh. I have added a <meta http-equiv="refresh" content="30"> line to make it auto refresh on it's own. But the users find it annoying that the page refreshes while they're working on it. They prefer to have their own button that will refresh both the main page that gets the data, and the iframe to read the new file. I tried to use document.getElementById(FrameID).contentDocument.location.reload(true); in various spots but it's not happy. i keep getting an error message that the object is null or doesn't exist. I also tried using contentWindow instead of contentDocument. made no difference. Any ideas? Hi all, I am really stuck on this: I have an iframe on my page <iframe id="displayframe">. I used security="restricted" to create a more 'secure' frame but that means that any forms which submit will be opened in a new window... away from my website. I also have a textbox, called "showurl" which acts as an 'address bar' to the iframe and the accompanying button "go". I read on Stanford's website that: "It is possible to use JavaScript inside the restricted iframe, by attaching event handlers from the outside (unrestricted) window. This allows the outer window to get around the restriction that hyperlinks in a restricted iframe are supposed to open in a new window. " So I would need a function that would detect when a new page has been opened (ie. a form has been submitted) and would be able to take the URL of the new page, copy the new page's URL into the textbox and click the button "Go" and close the new page (the one which just opened) All in all... The event handler needs to get the url of the submitted form page (the opened window) paste it into the textbox "showurl", click the button "go" and then close the opened window. Could anyone help me out on this? It would be greatly appreciated!! I'm using this code to force a PHP form to redirect. I already inserted a header for PHP and for whatever reason it's not working. This code works like a dream in Firefox, but it continuously loops in IE and makes it impossible to enter anything into the PHP form <body onload="javascript: self.location.href = 'index.html';"> </body> Does anyone know how to make this code not refresh IE literally every second? Thanks. I embedded the following into my blog; Code: <br><script language="javascript" src="http://www.quotedb.com/quote/quote.php?action=random_quote&=&=&"></script> <br> It works fine, but I'm trying to find a way to refresh only the script on my blog, instead of having to reload the entire page. Coding a refresh button, for instance. How would I go about doing this? Thank you in advance. Hello friends, I want to trigger click event on an iframe's element through the main window, Doing it both ways, with or without jquery, will be usable for me. Basically, what I want to do is, I have developed a website http://www.ipjugaad.com, and on every document download page, I have placed an fb like button, what I want to do is that the like button should be automatically clicked when a user click on download button on my website. Give me some idea about how to do it? Hi Everyone I'll explain the situation first: I need to build a website that allows students to select from a drop down list and then hit an 'Add button'. From there, that value will go to another part of the screen and display as bullets. Once that list is built, they can hit a final submit button that sends an email to someone with everything they selected. More Detail: LEFT SIDE OF SCREEN: [DROP DOWN LIST] <- this will have all the courses listed that we offer. Once once is selected. [ADD] <- add button that puts the values from the dropdown list to an array. RIGHT SIDE OF SCREEN: My Courses: * TEST1001 * TEST1002 This is being updated dynamically so that whenever the add button is hit, this lists grows. [SEND] <- Send button Thank you, You know how google has different ads everytime you go to a page? Well i want to do the same thing. I got two banners and i want one to change to the other banner when someone refreshes the page.
I'm just trying to make a simple interface. On the html form the user enters the time to start, time to end, and frequency of a reminder alert. I pass this to my javascript and then am trying to setup a 1 second loop where it checks against the clock to see if it's time to begin the reminders. I get to the function, but the setTimeout doesn't complete and my page just refreshes. Here's my javascript code for this section.... Code: //-----------Start Countdown--------------------------- function StartCountDown(startTime, endTime, freq){ now=new Date(); intToStart=startTime-now; intInSec=intToStart/1000; alert(intInSec + " sec"); if (now > startTime){ StartRepeat(endTime, Freq); } else{ var TTS=setTimeout("StartCountDown(startTime, endTime, freq);", 1000); } } function StartRepeat(endTime, freq){alert("Made it to StartRepeat Function"); if (freq != 0){ var task=setInterval("TaskRemind(endTime, freq)", freq); } else{ clearTimeout(task); } } function TaskRemind(endTime, freq){ alert("Do Task Now!"); now=new Date(); if (now <= endTime){ StartRepeat(endTime, freq); } else{ freq=0; StartRepeat(endTime, freq); } } Any help is greatly appreciated. Brian I'm poking in the blind with javascript and hope that you can help with this issue. A javascript function is making a call to an external php file, which checks the compares the current time with a time stored in a mysql database. If a certain time passes, the php will send back instructions to redirect the user to a different page. The issue is that the page refreshes every time the is javascript function is executed. This resets any forms, or videos that the user is watching on the page. Here is the relevant code: Code: function checkTimer() { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { window.location.href = xmlhttp.responseText; } } xmlhttp.open("POST","php/5minforpage10.php",true); xmlhttp.send(); } window.setInterval(checkTimer,15000); Is there a way to achieve the goal of checking the time against the server time (via the php code) without refreshing the page? Thanks kindly! Hai all, iam trying to use java script code in my jsp page. i used a onclick event.while clicking on the button that wil goes to the javascript function(deleteRecord(name,subject)). this deleterecord() wil post the url request. my code is like this ----------------- function deleteRecord(name,subject){ document.write("name received is:"+name); f.method="post"; var url="http://localhost/myproject/DeleteRecord?"; var url1= "name="+name; var url2="subject="+subject; var URL=url+url1+url2; f.action(URL); f.submit(); } my onclickevent code is' <td width="20%" height="25" align="left" valign="middle"><input type="submit" name="delete" value="Delete" style="background-color:#ff0000;font-weight:bold;color:#ffffff;" onclick="deleteRecord(<%=rs.getString("name")%>,<%=rs.getString("subject")%>);" /></td> --------------------------------------------- wil iam running my jsp page internet explorer is giving in variable subject (error:'divi' is invalid).divi is the value of the parameter name which iam passing to the function . and mozilla firefox my script is not working there is some syntax issues as wel as browser issues...and with url syntax can any one help me... Regards, Divya I have several list items in an html document. Each list item has an anchor tag and each anchor has an 'onmouseover' event. Is it possible to get the containing object for the event upon the mouseover? can someone please explain the code in this link. Just this small bit since i seen it in a few different places. it starts off with if (!e) ... please explain wth that means thank you so much heres the link - http://www.w3schools.com/js/tryit.as...ent_srcelement Hello everyone, If I type the name, and I check and Gender Scholar, my button will appear What I am looking to: Check my buttons, and when I start typing the name, the button Submit appear, st if I delete the text, the Submit button disappear Here's the script: Code: <head> <script type="text/javascript" src="jquery.validate.js"></script> <script> $(document).ready(function(){ $("#commentForm").validate(); }); function check_required(){ //alert(document.getElementById('rdo_boursier_oui').checked); //alert(document.getElementById('txt_lastname').value != ""); if((document.getElementById('rdo_boursier_oui').checked == true || document.getElementById('rdo_boursier_non').checked == true) && (document.getElementById('rdo_sexe_eleve_m').checked == true || document.getElementById('rdo_sexe_eleve_f').checked == true) && (document.getElementById('txt_lastname').value != "" ) ) { document.getElementById ('submit_etape2').style.display='block'; }else{ document.getElementById ('submit_etape2').style.display='none'; } } </script> </head> <form action="#" method="post" id="commentForm"> <input class="submit" type="submit" name="submit_etape2" id="submit_etape2" value="" style="display:none;"/> <p class="p_float"> <label for="lastname">Votre nom<span class="required_red">*</span></label> <input type="text" name="txt_lastname" id="txt_lastname" value="" class="required" minlength="3" onchange="check_required();" /> </p> <p class="p_float rdo"> <label for="boursier">Boursier<span class="required_red">*</span></label> <input type="radio" name="rdo_boursier" id="rdo_boursier_oui" value="" class="rdo_sexe_eleve snd_inscription required" onclick="check_required();"/>Oui <input type="radio" name="rdo_boursier" id="rdo_boursier_non" value="" class="rdo_sexe_eleve snd_inscription required" onclick="check_required();"/>Non </p> <p class="p_float rdo"> <label for="sexe">Sexe<span class="required_red">*</span></label> <input type="radio" name="rdo_sexe_eleve" id="rdo_sexe_eleve_m" class="rdo_sexe_eleve snd_inscription required" onclick="check_required();" value="">M <input type="radio" name="rdo_sexe_eleve" id="rdo_sexe_eleve_f" class="rdo_sexe_eleve snd_inscription required" onclick="check_required();" value="">F </p> </form> I assum the following html code: <div id="id1" onclick="click()">A<div> <div id="id2" onclick="click()">B<div> Do you know how to get ID = id2 when I onclick on A? hey, i am trying to add events to my website...i have all the events stored in my google calender and i am trying to show only four events at the time for example: 10/01/2011 - John's Birthday 12/01/2011 - Party i found this example on google however i am having problems...the problem i am having is that it works fine on my computer however when i look at it on another computer nothing appears http://gdata-javascript-client.googl...le_sample.html thanks Hi Everyone, How would i add an avent listener to change the source of an image? I have added the image to a canvas element through javascript using the code below. Code: var start = new Image(); start.src = "start.jpg"; ctx.drawImage(start, 50, 50); Thanks! Hello, I have a script I am using which works great, except when I copy the code and have multiple events it only shows the first one. This I believe is because it's calling the first class name of it's kind. I want the class's to be named the same thing (css styling) and because the site is going to be dynamically driven, but is there a way to modify my script so that instead of looking for the first class it recognizes the right class associated with the button clicked. If anyone can help me fix this problem I am having I would be most appreciative.. Code: <script language="javascript"> function toggle() { var ele = document.getElementById("commpopup"); if(ele.style.display == "block") { ele.style.display = "none"; } else { ele.style.display = "block"; } } </script> <div class="togglecomment"> <div class="popup" id="commpopup"> <div class="commentbtn"><a href="#"><img src="images/commenticon.png" align="absmiddle" />Comment</a></div> </div> <div class="button"><a href="javascript:toggle();"><img src="images/comment_btn.jpg" /></a></div> </div> hello everyone, i am new to all this.. i need help regarding.. i am generating text box dynamically(mean it's a multiple select box, depending upon the number you select , it will generate that many text field.) my problem is that i want to assign a calender to the text field generated whenever a user clicks on that text field. i am able to do it for simple text field as onclick="javascript: showCalendar('idname')" but how to do it in this case, where can i declare this ? Hi guys, Probably a simple fix, the below code is for a form that is validated against some external (valid.js) functions. It's my first forray into Event Delegation and stupidly (testing in FF only just now) I didn't realise that the addEventListener isn't recognised in IE. Anyone got an idea which way I should look at sorting it. I am still searching and playing around but can't seem to find the right solution. Thanks in advance Code: document.addEventListener('keyup',function(event){ //IE doesn't pass in the event object var event = event || window.event; //IE uses srcElement as the target var target = event.target || event.srcElement; var strId = target.id switch(target.id){ case "M_FIRSTNAME": validEmpty(strId,"* Please enter your 'First Name'."); validChars(strId,Letters,"* Your 'First Name' contains invalid characters."); break; case "M_LASTNAME": validEmpty(strId,"* Please enter your 'Last Name'."); validChars(strId,Letters,"* Your 'Last Name' contains invalid characters."); break; case "M_EMAIL": validEmpty(strId,"* Please enter your 'E-mail Address'."); validChars(strId,Email,"* Your 'E-mail Address' should be in the format you@email.com."); break; case "M_EMAIL_CONF": validEmpty(strId,"* Please confirm your 'E-mail Address'."); validChars(strId,Email,"* Your 'E-mail Address' should be in the format you@email.com."); break; case "M_USERNAME": validEmpty(strId,"* Please enter your 'Username'."); validChars(strId,Alphanumeric,"* Your 'Username' contains invalid characters."); //objRegister.M_USERNAME.withinRange(6,12,"* Your 'Username' should be between 6-12 characters."); break; case "M_PASSWORD": validEmpty(strId,"* Please enter your 'Password'."); validChars(strId,Alphanumeric,"* Your 'Password' contains invalid characters."); //objRegister.M_PASSWORD.withinRange(6,12,"* Your 'Password' should be between 6-12 characters."); break; case "M_PASSWORD_CONF": validEmpty(strId,"* Please confirm your 'Password'."); validChars(strId,Alphanumeric,"* Your 'Password' contains invalid characters."); //objRegister.M_PASSWORD_CONF.withinRange(6,12,"* Your 'Password' should be between 6-12 characters."); break; } },true); |