Jump to content

Search the Community

Showing results for tags 'javascript'.

  • 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

  1. I have an image that kind of serves as an opaque background, and once hovered the opaqueness goes away. Also, I have a row of list items to serve as a menu, and once hovered the color of the text darkens to become more visible. This works great. As long as the mouse is directly over each element. The text element is directly over the background. What I want though is to have the background stay apparent as the text is hovered over, instead of the background becoming opaque again if I hover directly over the text. Can this be done without Javascript? Or is there a way with CSS3 to have the element that's being hovered over and another element change while interacting with only the list/menu elements? I would prefer a CSS solution if possible. Thank you in advance! Or even to put CSS inside Javascript? like have an if then statement for the text that says if there is a rollover event on the text/tables then it initiates the CSS :hover for the background?I want to use CSS rather than Javascript as much as possible because 1) I understand CSS and not JS, and 2) JS is ugly. Thanks again!!
  2. Hello, I would like to do some calculations in a predefined array. With the script below I can retrieve a number of the matrix.However, I want to reuse this number and do some calculations with it, for example calculate the factorial. But I don't now how I have to save the selected number and then to reuse it for further calculation. can you help me? Thx,Roger <!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><title>MATRIX</title> </head><body><p>MATRIX</p><form action=''><table> <tr><td>Size:</td><td><input type='text' id='size' value='' /></td></tr> <tr><td>Line:</td><td><input type='text' id='line' value=''/></td></tr> <tr><td>Col:</td><td><input type='text' id='col' value=''/></td></tr> <tr><td>Selected:</td><td><input type='text' id='selected' value=''/></td></tr></table></form> <input value="show" type='button' onclick="see(document.getElementById('size').value/1, document.getElementById('line').value/1,document.getElementById('col').value/1)"/></div> <script>function matrix(a){ var myMatrix=new Array(); var value=1; for(var i=0; i<a; ++i){ myMatrix=new Array(); for(var j=0; j<a; j++){ myMatrix[j]= value; ++value; } }return myMatrix;}function see(x,y,z){ if(y>x-1 || y<0){ document.getElementById('selected').value="Error"; document.getElementById('line').className='error'; document.getElementById('line').value="Number between 0 and "+(x-1)+" please!"; } else if(z>x-1 || z<0){ document.getElementById('selected').value="Error"; document.getElementById('col').className='error'; document.getElementById('col').value="Number between 0 and "+(x-1)+" please!"; } else{ myMatrix=matrix(x); document.getElementById('line').className='correct'; document.getElementById('selected').value=myMatrix[y][z]; }}</script></body></html>
  3. Hi All, I was wondering if copy to clipboard is available for iframe. i tried to search on google and no joy. Could somebody please advise?Thanks in advance. Ok So I am having a website and there was already a copy to clipboard option for which i used Javascript code and that worked perfectly fine but now i have iframe and the copy to clipboard function does not work anymore. I have a html website. I have a web based page(html- frames format) for our text documents articles on various subjects. The page is made in three frames. It's exactly like this "http://www.w3schools.com/html/tryit.asp?filename=tryhtml_frame_mix". The copy to clipboard optionis for the articles displayed in the main menu.The code is: <SPAN ID="copytext" STYLE="height:;width:;background-color:"><p>Please do the following:<br /> 1. Click on Edit > Preferences<br /> 2. Select the Multimedia Trust (legacy) Category on left side of window<br /> 3. Select 'Other Documents' under 'Trust Options' frame<br /> 4. Select 'Permission for Adobe(R) Flash(R) Player is set to Prompt' in<br /> list box<br /> 5. Change value for Change permission for selected multimedia player<br /> to: 'Always'<br /> 6. Click 'OK' </p> <p>Kind Regards,</p></SPAN><TEXTAREA ID="holdtext" STYLE="display:none;"></TEXTAREA><BUTTON onClick="ClipBoard();">Copy to Clipboard</BUTTON> <script LANGUAGE="JavaScript"> function ClipBoard(){holdtext.innerText = copytext.innerText;Copied = holdtext.createTextRange();Copied.execCommand("RemoveFormat");Copied.execCommand("Copy");} </SCRIPT> For iframe i am using this : <iframe src="text.txt" frameborder="0" scrolling="yes" height="400" width="650"> Text file not found.</iframe>
  4. Hello Friends I have to visit a website which offers you Free Videos on various topics.Some Links I am posting here.AJAXhttp://learnerstv.com/Free-Computers-Video-lectures-ltv322-Page1.htmFundamentals of PHPhttp://learnerstv.com/Free-Computers-Video-lectures-ltv166-Page1.htmBasics of PHPhttp://learnerstv.com/Free-Computers-Video-lectures-ltv427-Page1.htm Regards,Er. Sumit Machra[+91-9414475695][http://brahmansh.in]
  5. hello there,i have a flash swf file with custom right click menu. file is embedded in html via javascript using swfobject.embedSWF() swfobject.embedSWF("gallery.swf", "GalleryDiv", "100%", "100%", "9.0.0", false, flashvars, params, attributes);i want to disable right click menu so that custom menu couldn't apear. can anyone help me. javascript code for this case is <script type="text/javascript"> var flashvars = {}; var params = {}; params.scale = "noscale"; params.salign = "tl"; params.wmode = "transparent"; params.allowfullscreen = "true"; params.menu="false"; var attributes = {}; swfobject.embedSWF("gallery.swf", "GalleryDiv", "100%", "100%", "9.0.0", false, flashvars, params, attributes); </script>thanks in advance
  6. I'm using the following code. By clicking on div id="popUpPane", the div and it's childs should appear and slowly fade in.By clicking on the div again, it should slowly fade out and then disappear.Firefox and Chrome (which is webkit too) behave that way and I know Safari did in an earlier version, too. But right know on Safari and on Safari Mobile nothing happens at all when I click on "popUpPane".Is this a bug in Safari or is there something I could change to come back to the intended behaviour?One addition: If I set -webkit-transition to -webkit-transition: opacity .5s ease-in-out; it works fine but the transition only appears on the first click. There's no transitions after that first one... If I delete the opacity-part in the java-script the opo-up works but there's no transition.All other transitions on my site are working. But they all use only opacity and no visibility.Here's my code:CSS:#popUpPane { white-space:normal; position:fixed; width:100%; height:100%; top:0; left:0; text-align:center; vertical-align:middle; visibility:hidden; z-index:90; } #greyOut { position:fixed; width:100%; height:100%; top:0; left:0; background-color:#000; opacity:0; }#popUpPicCanvas { position:relative; top:50%; margin-top:-325px; display:inline; opacity:0; z-index:100; }.fade { -webkit-transition: all .5s ease-in-out; -moz-transition: all .5s ease-in-out; -o-transition: all .5s ease-in-out; transition: all .5s ease-in-out; }HTML: <div id="popUpPane" onClick="noPopUp()"> <div id="greyOut" class="fade"> </div> <canvas id="popUpPicCanvas" width="1000" height="650" title="Bastian Beuttel" class="fade"></canvas> </div>Javascript:var popUpPane = document.getElementById("popUpPane"), greyOut = document.getElementById("greyOut"), popUpPicCanvas = document.getElementById("popUpPicCanvas"), popCanvasContext = popUpPicCanvas.getContext("2d");var doPopUp = function(source,x,y){ var popUpPic = document.getElementById("pic"+source); popCanvasContext.canvas.width = x; popCanvasContext.canvas.height = y; popCanvasContext.drawImage(popUpPic, 0, 0,x,y); popUpPane.style.visibility = "visible"; greyOut.style.opacity = "0.7"; popUpPicCanvas.style.opacity = "1";};var noPopUp = function(){ greyOut.style.opacity = "0"; popUpPicCanvas.style.opacity = "0"; popUpPane.style.visibility = "hidden";};I hope someone can help me.Thanks for your responds!
  7. Hi guys! I have turned to this forum beacuse I am tired of serching on the web, this problem is already fuzzing my brain. Well lets start from the beginning. I am building an HTML application, with javascript and xml. My XML file is as below: <cadastro> <instrumento> <diareg>2011/11/25</diareg> <id>0107006</id> <idsetor>1</idsetor> <idgrupo>7</idgrupo> <idsequencia>006</idsequencia> <nome>Escala Graduada de Aço</nome> <modelo>Mecanico</modelo> <fabricante>Stanley</fabricante> <nserie>--</nserie> <capacidademin>0.0</capacidademin> <capacidademax>600.0</capacidademax> <resolucao>0.5</resolucao> <unidade>mm</unidade> <complemento>Escala com duas graduações em milímetro e polegada</complemento> <estado>conforme</estado> <tipocalibra>ci</tipocalibra> <procedimento>IT-FLB-53-CQ-037</procedimento> <proxdiacalib>2012/8/21</proxdiacalib> <periodocalib>365</periodocalib> <ficha> <dia>2011/11/25</dia> <certificado>CQ225/11</certificado> <hiperlink>N/A</hiperlink> <diacalib>2011/8/22</diacalib> <erromin>0.0</erromin> <erromax>0.05</erromax> <erromed>0.025</erromed> <incerteza>0.01</incerteza> <situacao>calibrado</situacao> <historico>Disponível para o uso</historico> <status>Conforme</status> <valor>0</valor> </ficha> </instrumento> <instrumento> <diareg>2011/11/25</diareg> <id>0113025</id> <idsetor>1</idsetor> <idgrupo>13</idgrupo> <idsequencia>025</idsequencia> <nome>Micrômetro Externo</nome> <modelo>Mecanico</modelo> <fabricante>Mitutoyo</fabricante> <nserie>86437051</nserie> <capacidademin>0.0</capacidademin> <capacidademax>25.0</capacidademax> <resolucao>0.01</resolucao> <unidade>mm</unidade> <complemento>Micrometro para medição de canal do Zeta.</complemento> <estado>conforme</estado> <tipocalibra>ci</tipocalibra> <procedimento>IT-FLB-53-CQ-037</procedimento> <proxdiacalib>2012/1/16</proxdiacalib> <periodocalib>60</periodocalib> <ficha> <dia>2011/11/25</dia> <certificado>CQ330/11</certificado> <hiperlink>N/A</hiperlink> <diacalib>2011/11/17</diacalib> <erromin>0.1</erromin> <erromax>0.1</erromax> <erromed>0.1</erromed> <incerteza>0.01</incerteza> <situacao>calibrado</situacao> <historico>Disponível para o CQ</historico> <status>Conforme</status> <valor>0</valor> </ficha> </instrumento></cadastro> I`m using this xml file as a simple database for my application, were I control info about instruments as caliper, micrometer, scales, and a lot of measuring equipment.Well as you can see i have "Cadastro" as my root element, "Instrumento" or instrument is the element that holds the info of the equipment.For my problem i have to query on the xml three elements from "instrumento", they are: <idsetor></idsetor>: this one holds the sector which the equipment belongs to. (its a number)<idgrupo></idgrupo>: this oneindicates the group of the equipment like(Digital caliper, Pressure Gauge,...) (its a number) <idsequencia></idsequencia>: this one indicates the sequential number of the equipment by order of arrival and registry (caliper 001, caliper 002, ...,caliper NNN) the <id></id> is a combination formed by the 3 elements above.Well during the registry I input two variables the sector and the group but the sequential number should be generated automaticaly obeying the sequence of the already registered equipments. my logic is request all the instruments with the same <idsetor> and <idgrupo> and after select from this set, the one with the highest <idsequencia>, and then: idsequencia = idsequencia + 1; Now reading about Xpath in the internet I got to this two Xpaths: 1 - "cadastro/instrumento[idsetor=+IDSETORaux+" and idgrupo="+IDGRUPOaux+]/idsequencia"2 - "/cadastro/instrumento/idsequencia[not(/cadastro/instrumento/idsequencia>.)]" The first returns all the <idsequencia> of all the instruments that have the same idsetor and idgrupo, pointed by the variables IDSETORaux and IDGRUPOaux respectively. The second returns te highest <idsequencia> of all the registered elements. Well I have been playing with this two xpaths, combining them in diferent ways but no success. Now i turn to you and ask, can you help me please???
  8. I borrowed a script posted to a forum that should make the active menu display a specified color and background color. The menu is a spry menu for Dreamweaver that uses anchors inside of li's. You can view it at http://sweet-momentum-fitness.com at the bottom of the page. What am I missing?
  9. Hello internet - what I am trying to do is that I have two different regular buttons (preview and submit) and I also have two functions I named checkit and checkit2 - but now I would like checkit to post different information than checkit2 when the forms are sent to m m_post_process_4.php to be processed. How do I accomplish this? My form text is:<form name=tourney action="m m_post_process_4.php" method="post" target="_blank">My button text is:<input type="button" name="Preview" value="Preview"; onclick="checkit();" /><input type="button" name="Submit" value="Submit"; onclick="checkit2();" />
  10. So first my user enters their name. examplevar username = "Scott" So i want this to carry over to the next page. Right now var username is only accessible on this page. Right now, I start on the index.html, user enters name, on welcome.php it says hi scott, then on account.php I want it to say hi scott again, but it says that the value has not been declared. How can i transfer this variable using the URL or a form or something? By the way, welcome.php redirects to account.php, so it needs to be something automatic.
  11. I am having problems with getting the right syntax in Javascript to access and array set up in a form (for check boxes) via getElementById The setup on the form works fine because I can access it in PHP no problem. But can't get the syntax right in JS setup in PHP as followes while($row = mysql_fetch_row($result)) { print "<input type ='checkbox' class = 'selectedsurvey' id = 'SelectedSurveys[".$x."]' name = 'SelectedSurveys[".$x."]' checked='checked'/>"; print "<label>$row[1]</label>"; print "<br/>\n"; $x+=1; } They are read from a database of surveys My code in JS for(i=0;i<numberofsurveys;i++){ test = document.getElementById("SelectedSurveys"[i]); if (test.value == "on") { errmsg = errmsg + "'" + test.value + "',"; anychecked = true; } }if (!anychecked){ errmsg=errmsg+"Error: A site must contain at least 1 survey.<br/>"; } Any help much appreciated. PS test is already defined in a var earlier.
  12. Hello internet. I would like to start off by saying that W3Schools forum and all you great programmers that respond to these topics is INVALUABLE!!! Thank you so much. Here is my problem... I currently have only one form for my site<form name=tourney action="m m_post_process_4.php" method="post" onSubmit="return checkit()" target="_blank"> When all the requirements have been met (through the checkit function) the form is sent to the PHP file for processing. However, I have two submit buttons and would like each button to process a different function - one for checkit and one for checkit2. This may seem odd because you may say combine the two functions into one function but the problem I am running into is that I cannot seem to get the element ID during a submit action. If I could I would combine the two functions and run comparisons to do all the work. However, the PHP output keeps telling me "Undefined1" for the ID value I am trying to compare. Any thoughts?
  13. I have a question, we are creating a form that is currently a PDF document found on our website. We are creating a web based version of the form. I would like to know if the ability to print the form as a PDF once it is filled in by a user is a JavaScript command. If so if anyone can help with the scripting that makes that happen would be great, as well as any pointers as to how to control any formatting in the printed PDF that will be rendered. Thank you in advance for any assistance you can offer. For reference as to what we would like the form to resemble when printed a copy of the current form can be found at: http://spo.usu.edu/files/uploads/SP-01.pdf
  14. very short code, grabbed it from the net and was trying to learn it. very simple workout page. No matter what I try I can not get box4 to fall under the box1 at the top and next to two center panels. Tried all alignments I could think of. My primary frustration is the code for dragging the red square w/the id =mvBox should work but does not. Have gone over it several times and can not find the error. I put some code to track the mouse to try & debug and alert box to make sure the ball.js script source was correctly linking up. I read the code over several times. I see no errors. Thank you in advance for any help and advice. Tried the original code and it only moved the box down and rightward.<!DOCTYPE HTML><html lang="en"><head><meta charset="UTF-8"><title>Fill Shapes Example</title><script src="ball.js"></script><link rel="stylesheet" type="text/css" href="ball.css" /><script language="javascript"> var x; var y; function mouser(event){ x=event.clientX; y=event.clientY; document.getElementById('X-coord').innerHTML = x +'px'; document.getElementById('Y-coord').innerHTML = y +'px'; }</script></head><body onMouseMove="mouser(event);"><div id="wrapper"><div id="header"> </div><div id = box1>X: <span id="X-coord"></span><br><br>Y: <span id="Y-coord"></span> <script type =text/javascript> write(); </script> </div> <div id = box2>box2</div> <!-- Unless canvas size is specified default size is 300 w x 150 h --><canvas id="canvas" width="700" height="350" >[Fallback Message]</canvas><canvas id="canvas" width="700" height="350" >[Fallback Message]</canvas><div id = box3>box3</div> <div id = box4>box4</div> <div id = box5>box5</div> <div id=mvBox class=mvBox onMouseDown="mouse_down(event,'mvBox')" onMouseUp="mouse_up()"></div></div></body></html>css#wrapper{background-image: -ms-linear-gradient(bottom, #FFFFFF 0%, #9BEF81 100%);background-image: -moz-linear-gradient(bottom, #FFFFFF 0%, #9BEF81 100%);background-image: -webkit-linear-gradient(bottom, #FFFFFF 0%, #9BEF81 100%);margin-top:25px;margin-bottom:100px;margin-right:auto;margin-left:auto;padding: 50;}#box1{border:2px solid #000;padding:10px 40px; background: #CC3300;width:1000px;height: 150px;border-radius:25px;-moz-border-radius:25px; /* Firefox 3.6 and earlier */}#box2{float:left;border:2px solid #000;padding:0; background:#7DBD9D;width:150px;height: 700px;border-radius:25px;-moz-border-radius:25px; /* Firefox 3.6 and earlier */}#box3{top: 2000px;float:left;border:2px solid #000;padding:0; background: #7DBD9D;width:150px;height: 700px;border-radius:25px;-moz-border-radius:25px; /* Firefox 3.6 and earlier */}#box4{clear:both;border:2px solid #000;padding:0; background: #2E8A2E;width:1000px;height: 25px;border-radius:25px;-moz-border-radius:25px; /* Firefox 3.6 and earlier */}#box5{clear:both;border:2px solid #000;padding:0; background: #2E8A2E;width:1000px;height: 25px;border-radius:25px;-moz-border-radius:25px; /* Firefox 3.6 and earlier */}#mvBox {background: #FF0000;border:4px solid #000;width: 100px;height: 100px;position: absolute; top: 50px; left: 150px; z-index: 5; }canvas{margin-top:10px;margin-bottom:0px;margin-right:0;margin-left:0;float:left;background-color: #c0c0c0;border: 2px solid "#ddd";border-radius: 100px;-moz-border-radius: 100px; /* Firefox 3.6 and earlier */}and lastly jsvar x;var y;var element;var being_dragged = false;//function write()//{//alert("write something");//}function mouser(event){if(event.offsetX || event.offsetY) {x=event.offsetX;y=event.offsetY;}else {x=event.pageX;y=event.pageY;}document.getElementById('X').innerHTML = x +'px';document.getElementById('Y').innerHTML = y +'px';document.getElementById('X-coord').innerHTML = x +'px';document.getElementById('Y-coord').innerHTML = y +'px';if(being_dragged == true) {document.getElementById(element).style.left = x +'px';document.getElementById(element).style.top = y +'px';}}function mouse_down(ele_name) {being_dragged = true;element = ele_name;document.getElementById(element).style.cursor = 'move';}function mouse_up() {being_dragged = false;document.getElementById(element).style.top = y +'px';document.getElementById(element).style.left = x +'px';document.getElementById(element).style.cursor = 'auto';}
  15. bigjoe11a

    Nicedit

    I still haven't been able to get this to work. I get an error on line 37 in the code. can some one please help me fix this. I get an error of null is null or not an object. on line 37. Here is the home page http://nicedit.com/download.php and the owner took his forums off line and when I emailed him, He wanted me to pay him. Wel I attached to this post. Please any one. Joe nicEdit-.zip
  16. Hi guys im totally new to this. Im taking Transaction Processing I for the first time and it is ###### for me, first of all i am a total noob at this and my teacher doesnt teach at all so i am teaching my self. and sorry if i make mistakes on this post ( which is my first post of my life)..... so my question is this what is the javascript code for this particular function (lets call it p1) .... Below is the textarea named ta with the data from the spreadsheet pasted inside. XLdata col 1 col 2 col 3 row sum row 1 11 12 13 36 row 2 21 22 23 66 row 3 31 32 33 96 row 4 41 42 43 126 row 5 51 52 53 156 col sum 155 160 165 480 XLdata col 1 col 2 col 3 row sum row 1 11 12 13 36 row 2 21 22 23 66 row 3 31 32 33 96 row 4 41 42 43 126 row 5 51 52 53 156 col sum 155 160 165 480
  17. 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
  18. <?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?
  19. 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
  20. 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>
  21. 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
  22. 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
  23. 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
  24. 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
  25. 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.
×
×
  • Create New...