Jump to content

Search the Community

Showing results for tags 'JAVASCRIPT'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








  1. 1° - Sorry my English, I'm using Google translator. Hello, I'm trying to create a tool to change the background color of the site (blogger), but the way it did, it does not save the option of the visitor, every time the visitor has to click on the color. What code could I use to save cookies, or this way is impossible? See the code I'm using: <center><a href="#" onclick="javascript:document.body.style.backgroundColor='#59141b';"><img src="http://4.bp.blogspot.com/_dsEG33PDaHw/S32TTX4H60I/AAAAAAAAAJU/qYc4BYZclgg/s200/body-rojo.png" /></a><a href="#" onclick="javascr
  2. What are the advantages & disadvantages of PHP & JavaScript? Can anyone demonstrate the situations with code where it is better to make use of PHP and situations where it is better off to apply JavaScript? I'm asking this to best implement both the languages! Thanks in advance to the people who can help me! Thank you!
  3. <html><head><title>Korean Language School</title><script type="text/javascript"> function apply() { document.frm.sub.disabled = true; if (document.frm.chk.checked == true) { document.frm.sub.disabled = false; } if (document.frm.chk.checked == false) { document.frm.sub.enabled = false; } }</script></head><body><form id="apply" action="" name="frm"> <fieldset> <legend>Customer Information</legend> <dl> <dt><label for="name">Name</label></dt> <dd>
  4. I went over this plenty of times and no matter how many times I go over it, something goes wrong and I can't seem to figure it out. function validateEmail(email){var atNum=0;for(var i=0; i<email.length; i++){ //Checks for number of @ if(email.charAt(i)=="@"){ atNum++; }}alert("atNum: " + atNum);var atPos=email.indexOf("@");alert("atPos: " + atPos);var lastDotPos=email.lastIndexOf(".");alert("lastDotPos: " + lastDotPos);var user=email.substr(0,atPos);alert("user: " + user);var domain=email.substr(atPos+1,lastDotPos-1); //<-- ISSUEfor(var i=atPos+1; i<lastDotPos; i++){ alert("ema
  5. hey anyone, i have a problem about passing variable. gridpEmp.PHP <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><HTML><HEAD><TITLE></TITLE><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="Content-Style-Type" content="text/css"><meta http-equiv="Content-Script-Type" content="text/javascript"><script type="text/javascript">var preEl ;var orgBColor;var orgTColor;function HighLightTR(el, backColor,textColor){ var rowindex = el.sectionRowIndex; if(typeof(preEl)!
  6. Hi Guys, I'm a complete newbie here and have little to no experience with css, xml, javascript etc. however am now starting to teach myself. For this w3school seems to be a great place. I have a site currently that i am building however am looking for some help. I am interested in taking an XML feed from another site (betting odds) and several other different sites and feeding them onto my site. Basically to try and create an odds comparison area. I know this is me going in at the deep end but i sometimes find this is the easiest way to learn, if anyone is willing to help and guide me. Thanks,
  7. I have been trying to get this code to work for days now and I finally have to throw my hands up and ask for help. What seems like something easy is getting more difficult as I go line by line. Here is the concept, upon clicking to send a contact form - depending on which subject the client chooses, it will correctly show which fields need to be entered based for that specific selection, and upon php submit it will run validation and send by email ALL fields. (will tackle those issues next)The options for the subject bar, numbers 1&2 will never show/hide any specific fields (general entry)
  8. Hello people, i need help on my HTML5 Form with javascript. I have been looking over and over at my textbook as reference to do the scripting. [some with google] However, i dont seem to be able to generate a answer out from my codes. Does anyone know why and how i can fix it?Your help is deeply appreciated! Thank you! Here are my codes <script type="text/javascript"> function CalculateMEPS() { var amt = document.getElementsByName('mepsAMT').value; var bank = document.getElementsByName('bank').value; var selectedbank = document.get
  9. Hey there. I'm almost ready to launch my client's site, and there is one last problem with the current slideshow. <script type="text/javascript"> var imgSlide;var pic = 0;window.onload = function (){ imgSlide = document.getElementById('img'); // preload imagesimages = new Array();images[0] = new Image();images[0].src = "image1.jpg";images[1] = new Image();images[1].src = "image2.jpg";images[2] = new Image();images[2].src = "image3.jpg"; } function slide(){imgSlide.src = images[pic].src;if(pic < 2) // images.length - 1 can be used here{pic++;}else{pic = 0 }timer = setTimeout(slide, 5
  10. Hello very one, I've this peace of code which I cannot make it work. please some one help me with this <script type="text/javascript"> function disDropDown(){if(document.getElementById("one").value === "yes"){document.getElementById("two").disable='true'} else{document.getElementById("two").disable='false'}}</script> <form><select id="one"><option value="yes">Yes</option><option value="no">No</option></select> <select id="two"><option value="1">1</option><option value="2">2</option></select></form>
  11. I notice when I try to store html code in a variable and there is an ENTER between any code, the code does not work. Example: function displayRegister(){var a='<div></div>';} Code above is fine. function displayRegister(){var a='<div></div>';} Code above does not work. Is there a reason for this?
  12. Can someome please give me a dummy script that reads a data from a multilvel XML and parses it using Javascript and displays it in the html page. The catch is :- You are not allowed to use getElementByName and getElementById, etc... Only nodeType, childnode and other such attribuit is allowed.Please assist me here.
  13. <html><!--php_json.php--><head><script src="json2.js"></script><script src="php.js"></script><script>ajax("php_json.json",function(){oJSON = JSON.parse(xmlhttp.responseText);sJSON = JSON.stringify(oJSON);/*put it hereokay*/});// here, the variable sJSON is undefinedajax("php.php?json="+sJSON,function(){ alert(xmlhttp.responseText); });//</script></head><body></body></html> // php.jsfunction ajax(source,func){xmlhttp = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP") ? new
  14. var b = true;window.onload = function(){(b==true) ? function(){ var c = "Hello!"; func(c); } : null ;}function func(c){document.write("The word is " + c);} It seems that the function cannot be loaded in this tenary operator.Why's that?
  15. Hello web wizards.I am currently developing my site and have downloaded a query menu to implement in it. I have successfully installed in into my page in dreamweaver and kind of successfully styled it to my design. I am having problems with the width of each menu item, the <a>. It seems that when I view the code in Safari-develop-view web inspector, that there is extra divs and inline styles that are not in my HTML page in dreamweaver. I am posting the snippet of the HTML and a screen grab of the page in browsers code... Can anyone give me some idea as to where the div class +holder hori
  16. var ajax = function(query){xmlhttp = (window.XMLHttpRequest) ? xmlhttp=new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP") ? new ActiveXObject("Msxml2.XMLHTTP") : null ;xmlhttp.onreadystatechange = function(){ jsonData = JSON.parse(xmlhttp.responseText); (xmlhttp.readyState==4 && xmlhttp.status==200) ? func(query) : null ; }xmlhttp.open("GET","lib.json",true);xmlhttp.send();} function func(query){ // fail to check an undefined AJAX responseTextif(typeof(xmlhttp.responseText)=="undefined" && xmlhttp.responseText != null){ alert(0); }else { document.getElemen
  17. <title>Edit_Page</title></head><body><form id="frm2" name="frm2" method="post" action=" "><fieldset><legend align="center">Edit Student Info</legend><table align="center" border="0"><tr> <td>ID:</td> <td><input type="text" id="txtId" name="txtId" /></td></tr><tr> <td>First Name:</td> <td><input type="text" id="txtFname" name="txtFname" /></td></tr><tr> <td>Last Name:</td> <td><input type="text" id="txtLname" name=
  18. Hey everyone,This is my first post here, so please don't be too critical. Details: I'm coding a tabbed page and I have the basic layout set up as well as the javascript working to allow me to switch back and forth between tabs. Problem: The content I want to place in the Tabs are other HTML pages to be load and I'm totally oblivious on how to this. My code is below. What would I have to do in order to load the page without messing up any of the current functions or code? Much Thanks in advance <head><style type="text/css"> body { margin:40px; } #tabbed_box { margin: 0px au
  19. Could some of you tell me the basic protection that PHP & MySQL website needs. For example new stuff to me was SQL injection. Q: How to prevent website from SQL injection?Q: What other protection websites require than SQL injection protect? I know that the password should be crypted but somehow i think its not enough or is it?
  20. I want to count user who open the page , I want to insert in mysql table when user open the page and I want to insert or upadet when close the page by click [x] or press alt+F4 but not onunload or onbeforeunload , cause this also call when refresh I want to call this alert when close onlyI can use a code which insert when open and not insert when refresh , but I couldnt solve insert or update when close the pagehere is my code: <?session_start();if (!isset($_SESSION["visits"])) $_SESSION["visits"] = 0;if ($_SESSION["visits"] > 0){echo 'visit='.$_SESSION["visits"];echo "You hit the re
  21. Are they the same or are they different?
  22. So I have a standard two level menu in one php file that I show on all the pages on a website. The menus and submenus are nested <ul> elements. When you go to a page, I would like the submenu that includes that page to be open by default. And also to stay open if another submenu isn't hovered over. I think I can figure out the menu transformations. The part I need help on is finding the submenu that the active page is contained in so I can set that one to be open.
  23. I have this php script stop.php <?phpinclude('ssh_con.php');$stop = 'screen -S testapplication -X quit';ssh2_exec($con, $stop);mysql_query("UPDATE servers SET Online=0 WHERE Owner='".$_SESSION['Username']."'");echo "<meta http-equiv='refresh' content='0;index.php'>";?> now i want to execute/call/get this page/script using javascript onclick to execute the code and the page refreshes itself. Can anyone guide me to do this? Thanks before hand.
  24. I'm working on a site and i want to use icons to select travel modes,i have an working function but it only works with a selection input.Is there a way to modify it to be used with buttons? Thanks in advance! Function: function calcRoute() { var selectedMode = document.getElementById("mode").value; var request = { origin: thuis, destination: kabk, // Note that Javascript allows us to access the constant // using square brackets and a string value as its // "property." travelMode: google.maps.TravelMode[selectedMode] }; directionsService.route(request, function(response, stat
  25. Hello w3s... when im running this code: <?php$news_query = "SELECT * FROM news";$news_expanded = "SELECT * FROM news WHERE added + ( 3600 *24 *45 ) >".time()." ORDER BY added DESC LIMIT 10"; $news_result = mysql_query($news_query)or die(mysql_error());if(mysql_num_rows($news_result) > 0){$id = 1;while($n_row = mysql_fetch_assoc($news_result)){$id++; echo '<div id="pic'.$id.'"><a href="javascript: klappe_news('.$id.');">'."<img src='styles/images/backgrounds/icons/minus.gif' />".'</a></div><a href="javascript: klappe_news('.$id.');">'.$n_row['n_dat
  • Create New...