Jump to content

Search the Community

Showing results for tags 'Javascript'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

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

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 841 results

  1. Hi guys i want some help with a simple problem i have.Okay so im a new student and i have this website http://geeksqueaks.co.uk. Im trying to do this thing where the user clicks a button, this opens a message box, which the user then puts in a password, if the word is correct i want to be able to show a document.I hope this makes sense! Thanks guys
  2. <?xml version="1.0" encoding="utf-8"?><root><marquee>marquee 1</marquee><marquee>marquee 2</marquee><marquee>marquee 3</marquee><marquee>marquee 4</marquee><marquee>marquee 5</marquee><marquee>marquee 6</marquee><marquee>marquee 7</marquee><marquee>marquee 8</marquee><marquee>marquee 9</marquee><marquee>marquee 10</marquee></root> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title><script>function parseXML(method,xml,async){if(window.XMLHttpRequest){ xmlhttp = new XMLHttpRequest(); xmlhttp.open(method,xml,async); xmlhttp.send(); }else { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP") ; xmlhttp.async=async; xmlhttp.load(xml); }xmlDoc = xmlhttp.responseXML;}parseXML("GET","marquee.xml",false);function marquee(){for(var i=0; i<10; i++)document.getElementById("marquee").innerHTML += xmlDoc.getElementsByTagName("marquee")[i].childNodes[0].nodeValue+"<br />";}</script></head><body onload="marquee();"><marquee bgcolor="#FFFF99" width="300" height="100" id="marquee" behavior="scroll" direction="up" scrollamount="5"></marquee></body></html> My problem is strange. When the address is:http://localhost/marquee.htmlIt works in both FF & IE. When the address is:C:\xampp\htdocs\marquee.htmlIt just works in FF.(I'm using XAMPP at present.) In IE Developer Tool,This line: xmlhttp.open(method,xml,async); is considered: access denied What does it mean? And how can I fix it?
  3. Here is the location of the comments I need help with on my scrap Blogger/blogspot blog. I'm trying to move the replies under the ones they reply to. 1. I want to move the reply starting from the <li> node it is in, then 2. place it in a <ul> tag with the class "children" inside of the <li> node of which the comment replies to 3. I also want to remove the <a>reply</a> from the moved comment(s) Help me please
  4. The following adapted code taken from this page works in firefox (and I assume some other browsers), but it does not work in internet explorer. The specific part, which stops the script entirely in IE is highlighted in red bold below. Is there a work around to solve this problem so that I can change the content of a style sheet dynamically - using onClick etc Thanks as always for your time. <html><head> <style id="poo" readonly=false>#myAnchor{color:green}</style><script type="text/javascript">function changeLink(){document.getElementById('poo').innerHTML="#myAnchor{color:red}"; document.getElementById('myAnchor').innerHTML="W3Schools";document.getElementById('myAnchor').href="http://www.w3schools.com";document.getElementById('myAnchor').target="_blank";}</script></head><body> <a id="myAnchor" href="http://www.microsoft.com">Microsoft</a><input type="button" onclick="changeLink()" value="Change link"> </body></html>
  5. ok i create a slideshow "from an tuts" which works pretty well with words, but when it comes to images it doesnt really center and keep the height that i want 0.o how do i fix this? or am i missing something, anywho ill go buggin around with it, n if i fix it ill show wat i did or explain wat i did but i would like some opinions tho i work better with opinions
  6. I have an XML file and I want to manipulate it from user input and save the changes to the same file. Is this possible with javascript? I know how to load the XML file and manipulate the nodes but not how to save it. I have tried to search google and the forums aswell as reading the tutorials but I have not been able to find anything
  7. Hello, I am installing a javascript imageslider on my website. But I want to be able to store the "image-link" in a database, so every user can have his own images. This comes from the slidercode (jas.js): var JaS = {// Customization parametersimagePath : "../pictures/",images : [["1.jpg", "Bat bridge in Austin"],["2.jpg", "Blossoming tree", "Tree"],], A lot of other vars are beneath here. ---------- Right now it works with this: <button type="button" onclick="showUser(this.value)" value="<?php echo $_SESSION['myusername']; ?>">Change content</button> <br /> <div id="myDiv"><h2>Let AJAX change this text</h2></div> Javascript code I got mostly from w3schools.com:(str = <?php echo $_SESSION['myusername']; ?> --> username of the current user) function showUser(str){if (str=="") { document.getElementById("myDiv").innerHTML="no username"; return; }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) { document.getElementById("myDiv").innerHTML=xmlhttp.responseText; } }xmlhttp.open("GET","../modules/get.php?q="+str,true);xmlhttp.send();} This is my php file (get.php):(it has a database connection) <?php$q=$_GET["q"];$sql="SELECT * FROM pictures WHERE username='".$q."'";$result = mysql_query($sql);while($row = mysql_fetch_array($result)) { echo "['" . $row['path'] . "', '" . $row['title'] . "'], </br>"; }?> The output is: ['1.jpg', 'Bat bridge in Austin'],['2.jpg', 'Blossoming tree'], ---------- So I want to combine the 2 codes so the image slider will select the right images automatically by connection to the database and getting the "image-links" which correspond with the username. I want this to happen without having to push a button (--> automatically ). I'm not an experienced user/writer of javascript at all, so I hope someone on this forum can help me out. ~ xemx
  8. Please help me convert the below vbscript to javascript : set xmlDoc=CreateObject("Microsoft.XMLDOM")xmlDoc.async="false"xmlDoc.load("nba.xml")for each x in xmlDoc.documentElement.childNodes;document.write("<b>" + x.nodename + "</b>");document.write(": ");document.write(x.text);document.write("<br>");next Thanks in advance
  9. Please help me convert the below small code from vbscript to javascript, set xmlDoc=CreateObject("Microsoft.XMLDOM")xmlDoc.async="false"xmlDoc.load("nba.xml")for each x in xmlDoc.documentElement.childNodes;document.write("<b>" + x.nodename + "</b>");document.write(": ");document.write(x.text);document.write("<br>");next Thanks in advance.
  10. Hi,I have a xml file in the following format<employee><name>a1</name><age>22</age> <company> <name>company1</name> <address>address1</address> </company><tenure>3yrs</tenure></employee> I want to parse the xml file in javscript without using any getelementById or getelementByName. I was able to parse the xml using nodeValue, nodeType, however I am not able to parse inside the "company" tag (as company is a second level node). I am just able to extractname=a1age=22company=tenure=3yrs. Can someone please assist me with the script to even parse inside company tag using nodeType and nodeValue.Thanks in Advance !!
  11. The following code retrieves the text from the element with id="Text" and puts it in the element with id="putText": <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Get text and put in element</title></head> <body> <p id="Text">$1,200.00</p> <p id="putText"></p> <script type="text/javascript">function getTextAndPutInElement(id) { var source = document.getElementById(id); var target = document.getElementById("putText"); target.innerHTML = source.innerHTML;}getTextAndPutInElement("Text");</script> </body></html> The problem is that $1,200.00 is generated by an other script. When the page is loaded, you will have this result: <p id="Text">$1,200.00</p><p id="putText">$1,200.00</p> But in the meantime the text can change: <p id="Text">$1,500.00</p><p id="putText">$1,200.00</p> The script with function getTextAndPutInElement only runs ones when the page is loaded, so it doesn't know the text has been changed in the meantime. The content of the element with id="Text" looks something like this: <p id="Text">function otherScript(id) {...code that changes the text}</p> How can you load this script: function getTextAndPutInElement(id) { var source = document.getElementById(id); var target = document.getElementById("putText"); target.innerHTML = source.innerHTML;} everytime function otherScript is run?
  12. I´d like to get the amount between "(+$" and ")" and add it to the value of the inputbox. For example, you select the following:Solero Exotic (+$1.85)Cappuccino (+$2.49)iMac 27-inch 3.1GHz (+$1,999.00) These amounts will be subtracted from the options you've selected:1.852.491,999.00 The inputbox will display: 2003.34 But here's the tricky part, I need to do this without changing the existing attribute values or adding new attributes to the Option tag. Anyone know a javascript code that can do this? If possible, please post a sample. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Get Amount And Put Elsewhere</title></head> <body> <form action=""> <fieldset> <ul style="list-style:none;padding-left:0;"> <li>Ice Cream: <select class="optionsIceCream" name="IceCream"> <option value="IceCream01">Select Ice Cream</option> <option value="IceCream02">Solero Exotic (+$1.85)</option> <option value="IceCream03">Magnum Ecuador (+$4.85)</option> <option value="IceCream04">Cornetto Enigma (+$2.00)</option> </select> </li> <li>Coffee: <select class="optionsCoffee" name="Coffee"> <option value="Coffee01">Select Coffee</option> <option value="Coffee02">Cup of Joe (+$0.99)</option> <option value="Coffee03">Cappuccino (+$2.49)</option> <option value="Coffee04">Latte Macchiato (+$2.99)</option> </select> </li> <li>Computers: <select class="optionsComputers" name="Computers"> <option value="Computer01">Select Computer</option> <option value="Computer02">Dell Inspiron 620 (+$449.99)</option> <option value="Computer03">HP Pavilion dv7t (+$949.99)</option> <option value="Computer04">iMac 27-inch 3.1GHz (+$1,999.00)</option> </select> </li> </ul> Total: <input class="totalAmount" type="text" disabled="disabled" value="0.00" /> </fieldset> </form> </body></html>
  13. Hi All, I've written some Javascript that will dynamically add "file" inputs to a form. They show up on the page just fine when the add control is clicked. But, when I submit the form, those dynamically added form fields are absent from the form structure on the receiving page. They're also absent from the form structure passed to the validation function. The added fields are added to a table within the form tags. The JS code adds table rows (TR). Then, cells are added to that row. Then, the file inputs to the cells. All this is done using DOM methods like appendChild(), createElement(), createTextNode(), etc. Is there some extra step needed to make sure the added fields are made part of the form?
  14. I have two amounts, each one in an element. I'd like to add them together and put them in an other element. Anyone know a Javascript that can do this? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Add amounts and put in element</title></head> <body> <p id="firstAmount">$1,133.79</p> <p id="secondAmount">$1,900.00</p> <br /> Total: <p id="totalAmount">$0.00</p> </body></html>
  15. I have a Javascript that retrieves the text from between the "p" tags and put it in the title value, like this: before:<option title="" value="Put Text">Put Text</option> after:<option title="$1,179.83" value="Put Text">Put Text</option> The only problem is, it doesn't work in ie6-8. Does anyone know how to make this code work in ie6-8? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Get text and put in attribute value</title></head> <body> <div class="Text"><p>$1,179.83</p></div> <form action=""> <fieldset> <select class="putText" name="put-Text"> <option id="" class="putTextOption" value="Put Text">Put Text</option> </select> </fieldset> </form> <script>window.onload=function() { var pTag = document.getElementsByClassName("Text")[0].getElementsByTagName("p")[0]; var amount = pTag.innerHTML; document.getElementsByClassName("putTextOption")[0].title=amount;} </script> </body></html>
  16. When you click a certain tag, an option will be selected. For example: you click on a Div tag with id="object3", this action will automatically select the Option tag "Water". Anyone know a Javascript that can do this (without using the value attribute)? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Click tag will select option</title></head> <body> <form action=""> <fieldset> <ul style="list-style:none;"> <li> <select id="select_items" name="SelectItems"> <option id="item-fire" value="xjakgd">Fire</option> <option id="item-earth" value="yuygas">Earth</option> <option id="item-water" value="piowqe">Water</option> <option id="item-wind" value="mnbvzi">Wind</option> </select> </li> </ul> </fieldset> </form> <div id="click-object-1" style="background-color:#F00;width:30px;height:30px;margin:4px;cursor:pointer;"></div><div id="click-object-2" style="background-color:#0F0;width:30px;height:30px;margin:4px;cursor:pointer;"></div><div id="click-object-3" style="background-color:#00F;width:30px;height:30px;margin:4px;cursor:pointer;"></div><div id="click-object-4" style="background-color:#FF0;width:30px;height:30px;margin:4px;cursor:pointer;"></div> </body></html>
×
×
  • Create New...