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. I have this as one of my switch statements as the default: default: document.getElementById("default2").innerHTML = window.alert("I don't know that color."); break; The pop-up box appears and says the message, but when I click "ok" the word "undefined" shows up on the screen. How do I make it so the box pops up, and when you click "ok" nothing shows up on the screen?
  2. So, I have a general question. I learned javascript on codecademy, which doesn't teach much just very basic javascript concepts. This leaves me wondering how to do many basic things that could be applied to programs. One general question I have couldmake a program I am working on right now much cooler. My question is, how do use javascript to change the background-color of anything. I do not have a specific code to share, but here is my html: <!DOCTYPE html><html><head> <link rel='stylesheet' href='style.css'/> <script src='script.js'></script></head><body onclick = "change()"></body></html> My css: body{ background-color: blue} My javascript: function change(){ } Obviously this is just about as basic as it gets. My questions is how do I write the function to change the background-color? I know it is probably simple, but I have never learned. Please help.
  3. Hey so I am creating just a fun program where you can mix and match different tops, pants, and shoes. When you click an arrow button it changes the top, pants, or shoes. My code is not work. Please help, I think the problem is the way the link are placed. Please help. Here is my html: <!DOCTYPE html><html><head> <link rel='stylesheet' href='style.css'/> <script src='script.js'></script></head><body> <div class = "top"><div id = "randomtop"></div></div> <div id = "topright" onclick="toprightfnc()"><img class = "imgright" src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALMAAAEaCAMAAABtrpZTAAAAM1BMVEX///+/v7+8vLzd3d3b29vBwcHs7OzMzMz7+/vX19fr6+vOzs709PTExMTg4ODn5+f29vaQxP3sAAAC50lEQVR4nO3d227iQBCE4eCEZMkCyfs/7bKKUAz4MB5Puqviv665+DTqLkuW8Dw9FeR8LvmVVM5d54Y+d7udGfr5QjZDf5Gt0FeyEfqbbIPuk03Qt2QL9D3ZAP1IlkcPkcXRw2Rp9BhZGD1OvqCfs3WDmSKLoqfJkug5siD6ZZYsh54/ZTl0GVkKXUoWQpfMshh6CVkEvYwsgV5KFkAvJ6eja8jJ6DpyKrqWnIiuJ6eh15CT0OvIF/SLHTkBvZ4cjm5BDka3IceiPxqZQYMGDboWfXBEW540aNCgq/PuWHmgQYMGDRo0aNCgQYPeGPrVEf3eyAx6LpbjARo0aAV0I7Mp+q8jmpkGDRp0Hdqy8kCDFkFbLiJo0OM5NjLTHqBBr8jRsj1AR6EbmUHPoveG6FdHtOd4gAY9gebhEoW2rDzQoCfQjcygQcugLRcRtB36zRFNe4CeQAfO9KcjeuPtARq0BtqyPUCHoR1n2nIRPdEnQ/TZ71XvRyPxbrc/RpFbnTLkGPIn5ACy4WAYkg0HAzJkyJCLc/IjG54yZMiQ08iGJQf5V5GbvS2KWz/IkH+Y7Ld+HWTIg4EcQd7/gQz5Md3JkGy3fpAhD8dv/QxLzpBs2cuGZLvGgDyR8kuRZ8lRs9yMHPcoaUcO6+UtDwZkyJAhQ1YjB4k3fsp+5DfIAWTDwQgjt7rg25McJN42OawxIEOGfE+mlyEPksP+Crrp9YM8ngNkK3JYyUH2Ioc9Sja9fpAh/xpykBgy5B8nG64f5PG0ugo9kNwKHfl9qEboYHILdDh5/f3tCeS16BTyuvGI/AjvTerv5ksj1590Irn2pJNmeQ06mVyDTicvv5tPgLy0pyXIy9CpjdFP+UzLkMvRQuRStBS5DC1GLkGLNEY/cz0tSJ5DS5Kn0XKzfM04WpY8vojC5DG0NHkYLU4eQsuTH9EG5Pv2sCDfok3IfbQN+RttRL6irchft9Wakf+j7cgX9CFb0M8/kH9frqpfpFQAAAAASUVORK5CYII="></img></div> <div id = "topleft"><img class = "imgleft" src = "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcR1pyUMwdx_XBdS_318Mi-l39JKwwmrTJ6onBiVNM-WpyEul9Er"></img></div> <div class = "moretop"></div> <div class = "pants"></div> <div id = "pantsright"><img class = "imgright" src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALMAAAEaCAMAAABtrpZTAAAAM1BMVEX///+/v7+8vLzd3d3b29vBwcHs7OzMzMz7+/vX19fr6+vOzs709PTExMTg4ODn5+f29vaQxP3sAAAC50lEQVR4nO3d227iQBCE4eCEZMkCyfs/7bKKUAz4MB5Puqviv665+DTqLkuW8Dw9FeR8LvmVVM5d54Y+d7udGfr5QjZDf5Gt0FeyEfqbbIPuk03Qt2QL9D3ZAP1IlkcPkcXRw2Rp9BhZGD1OvqCfs3WDmSKLoqfJkug5siD6ZZYsh54/ZTl0GVkKXUoWQpfMshh6CVkEvYwsgV5KFkAvJ6eja8jJ6DpyKrqWnIiuJ6eh15CT0OvIF/SLHTkBvZ4cjm5BDka3IceiPxqZQYMGDboWfXBEW540aNCgq/PuWHmgQYMGDRo0aNCgQYPeGPrVEf3eyAx6LpbjARo0aAV0I7Mp+q8jmpkGDRp0Hdqy8kCDFkFbLiJo0OM5NjLTHqBBr8jRsj1AR6EbmUHPoveG6FdHtOd4gAY9gebhEoW2rDzQoCfQjcygQcugLRcRtB36zRFNe4CeQAfO9KcjeuPtARq0BtqyPUCHoR1n2nIRPdEnQ/TZ71XvRyPxbrc/RpFbnTLkGPIn5ACy4WAYkg0HAzJkyJCLc/IjG54yZMiQ08iGJQf5V5GbvS2KWz/IkH+Y7Ld+HWTIg4EcQd7/gQz5Md3JkGy3fpAhD8dv/QxLzpBs2cuGZLvGgDyR8kuRZ8lRs9yMHPcoaUcO6+UtDwZkyJAhQ1YjB4k3fsp+5DfIAWTDwQgjt7rg25McJN42OawxIEOGfE+mlyEPksP+Crrp9YM8ngNkK3JYyUH2Ioc9Sja9fpAh/xpykBgy5B8nG64f5PG0ugo9kNwKHfl9qEboYHILdDh5/f3tCeS16BTyuvGI/AjvTerv5ksj1590Irn2pJNmeQ06mVyDTicvv5tPgLy0pyXIy9CpjdFP+UzLkMvRQuRStBS5DC1GLkGLNEY/cz0tSJ5DS5Kn0XKzfM04WpY8vojC5DG0NHkYLU4eQsuTH9EG5Pv2sCDfok3IfbQN+RttRL6irchft9Wakf+j7cgX9CFb0M8/kH9frqpfpFQAAAAASUVORK5CYII="></img></div> <div id = "pantsleft"><img class = "imgleft" src = "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcR1pyUMwdx_XBdS_318Mi-l39JKwwmrTJ6onBiVNM-WpyEul9Er"></img></div> <div class = "morepants"></div> <div class = "shoes"></div> <div id = "shoesright"><img class = "imgright" src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALMAAAEaCAMAAABtrpZTAAAAM1BMVEX///+/v7+8vLzd3d3b29vBwcHs7OzMzMz7+/vX19fr6+vOzs709PTExMTg4ODn5+f29vaQxP3sAAAC50lEQVR4nO3d227iQBCE4eCEZMkCyfs/7bKKUAz4MB5Puqviv665+DTqLkuW8Dw9FeR8LvmVVM5d54Y+d7udGfr5QjZDf5Gt0FeyEfqbbIPuk03Qt2QL9D3ZAP1IlkcPkcXRw2Rp9BhZGD1OvqCfs3WDmSKLoqfJkug5siD6ZZYsh54/ZTl0GVkKXUoWQpfMshh6CVkEvYwsgV5KFkAvJ6eja8jJ6DpyKrqWnIiuJ6eh15CT0OvIF/SLHTkBvZ4cjm5BDka3IceiPxqZQYMGDboWfXBEW540aNCgq/PuWHmgQYMGDRo0aNCgQYPeGPrVEf3eyAx6LpbjARo0aAV0I7Mp+q8jmpkGDRp0Hdqy8kCDFkFbLiJo0OM5NjLTHqBBr8jRsj1AR6EbmUHPoveG6FdHtOd4gAY9gebhEoW2rDzQoCfQjcygQcugLRcRtB36zRFNe4CeQAfO9KcjeuPtARq0BtqyPUCHoR1n2nIRPdEnQ/TZ71XvRyPxbrc/RpFbnTLkGPIn5ACy4WAYkg0HAzJkyJCLc/IjG54yZMiQ08iGJQf5V5GbvS2KWz/IkH+Y7Ld+HWTIg4EcQd7/gQz5Md3JkGy3fpAhD8dv/QxLzpBs2cuGZLvGgDyR8kuRZ8lRs9yMHPcoaUcO6+UtDwZkyJAhQ1YjB4k3fsp+5DfIAWTDwQgjt7rg25McJN42OawxIEOGfE+mlyEPksP+Crrp9YM8ngNkK3JYyUH2Ioc9Sja9fpAh/xpykBgy5B8nG64f5PG0ugo9kNwKHfl9qEboYHILdDh5/f3tCeS16BTyuvGI/AjvTerv5ksj1590Irn2pJNmeQ06mVyDTicvv5tPgLy0pyXIy9CpjdFP+UzLkMvRQuRStBS5DC1GLkGLNEY/cz0tSJ5DS5Kn0XKzfM04WpY8vojC5DG0NHkYLU4eQsuTH9EG5Pv2sCDfok3IfbQN+RttRL6irchft9Wakf+j7cgX9CFb0M8/kH9frqpfpFQAAAAASUVORK5CYII="></img></div> <div id = "shoesleft"><img class = "imgleft" src = "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcR1pyUMwdx_XBdS_318Mi-l39JKwwmrTJ6onBiVNM-WpyEul9Er"></img></div> <div class = "moreshoes"></div></body></html> And here is my javascript: function picture(img) { this.link = link;}//*All clothingvar top = new picture(https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQqsdG9ZJSEOvFjdUC3Z8SpHh02ML1kbmoq-zF8thO6OiPRESR_);var top2 = new picture(https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQqsdG9ZJSEOvFjdUC3Z8SpHh02ML1kbmoq-zF8thO6OiPRESR_);var pants = new picture();var pants2 = new picture();var shoes = new picture();var shoes2 = new picture();//*All topsvar tops = [top, top2];//*All pantsvar pants = [pants, pants2];//*All shoesvar shoes = [shoes, shoes2];//*topright random generatorfunction toprightfnc(){ var random = Math.floor(Math.random() * tops.length); var tops_generate = tops[random]; document.getElementById("randomtop").innerHTML = tops_generate.link;} Why isn't it working?
  4. I was wondering if someone could help me. We were learning some basic javascript in class and I can't seem to get my form to validate. Basically all I wanted it to do is return an error when nothing is entered in the field. I've done it the way we were taught in class via examples. Any help would be much appreciated!! index.html
  5. Hi guys, So I set up a few boxes on a page and want a random one to disappear whenever any box is clicked on. I am a little rusty and was never that good at coding so this is just for fun/practice. My divs are set up as having id's square(1-18) My jquery code is: $(document).ready(function() { $("div").mouseenter(function() { $(this).animate({ height: '+=50px', width: '+=50px', fontSize: '+=100px'}); }); $("div").mouseleave(function() { $(this).animate({ height: '-=50px', width: '-=50px', fontSize: '-=100px' }); }); var num = math.floor(math.random() * 18) + 1; var n = num.toString(); var sEvent = "'" + "#" + "square" + n +"'"; $("div").click(function() { $(sEvent).toggle(400); }); }); the first 2 sections work fine but I cant get my click function to work properly. Please let me know your thoughts!
  6. Hello everyone! My name is Ron Kane and I am an accomplished web developer and technical writer having done many technical manuals, general information and "how-to"s in the Content Management field. I have significant success in utilizing the Adobe Suite and Microsoft SharePoint products with respect to creating content and following industry based style guides. My biggest success to date was working with one of my past company's Chief of Staff for a SVP in revamping their entire Intranet portal. This portal went from being unprofessional looking and having no web traffic to being very professional looking and increasing the traffic to it ten-fold. Right now, I'm reading through the HTML tutorials in preparation for my first ever HTML certification through here to gain recognition for my commitment to improving my skills and to meet with fellow web developers on here. Ask away if you have quesitons and I'm glad to be on here! Ron
  7. The menu bar links are active even when the menu bar is closed. I know the problem has to be in the javascript. I don't know javascript, how do you turn off the nav when the menu bar isn't open? I attached sample code so you can see the problem yourself. $(document).ready(function(){ /* Hamburger Menu */ $('.hamburger').on('click', function(e){ e.preventDefault(); $(this).toggleClass('opned'); $('header nav').toggleClass('active'); }); sample code.zip
  8. HI. I am trying to draw a animated curve. The curve is drawn. But the animation to draw the curve is not correct. please help me how to draw.My code is <!DOCTYPE html><html><body><canvas id="myCanvas" width="300" height="150">Your browser does not support the HTML5 canvas tag.</canvas><script>var c = document.getElementById("myCanvas");var ctx = c.getContext("2d");var c1 = document.getElementById("myCanvas");var ctx1 = c.getContext("2d");var canvas = document.getElementById('myCanvas');var context = canvas.getContext('2d');var amount = 0.5;var amount1 = 0;var amount3 = 0.4;var x = 23; var y = 22; var radius = 9; var startAngle = 7.75* Math.PI; var endAngle = 0.3 * Math.PI; var counterClockwise = false;var myVar4 = setInterval(function(){ myTimer4() }, 275);function myTimer4() { amount3 += 0.05; // change to alter duration if (amount3 > 1) amount3 = 1;context.beginPath(); context.arc(x, y, radius, startAngle*amount3, endAngle, counterClockwise); context.lineWidth = 1; context.stroke();}</script>
  9. Hello, I recently used this code that I got from a working fade in slider on the internet. The only thing I've changed are the images, the rest has stayed the same. When I load up the site in Safari it doesn't slide or fade, it just shows one image the entire time. What am I doing wrong? Heres the code I used from the internet HTML <div class="fadein"> <img src="http://farm9.staticflickr.com/8359/8450229021_9d660578b4_n.jpg"> <img src="http://farm9.staticflickr.com/8510/8452880627_0e673b24d8_n.jpg"> <img src="http://farm9.staticflickr.com/8108/8456552856_a843b7a5e1_n.jpg"> <img src="http://farm9.staticflickr.com/8230/8457936603_f2c8f48691_n.jpg"> <img src="http://farm9.staticflickr.com/8329/8447290659_02c4765928_n.jpg"></div> CSS .fadein { position:relative; height:320px; width:320px;}.fadein img { position:absolute; left:0; top:0;} JS $('.fadein img:gt(0)').hide();setInterval(function () { $('.fadein :first-child').fadeOut() .next('img') .fadeIn() .end() .appendTo('.fadein');}, 4000); // 4 seconds
  10. Hello, To start, sorry for my english i'm French ^^ I have a problem, in fact I can't retrieve the index of the row in a table. I tried many things but I haven't found the solution. Here is my code: <script id='TableSuser'> var oTableSuser = new sap.ui.table.Table({editable:false, width: "400px", visibleRowCount:2}); var oControl = new sap.ui.commons.Button({text : "{suser}", press : function() {openDialog(oTableSuser.getSelectedIndex());}}); oTableSuser.addColumn(new sap.ui.table.Column({label: new sap.ui.commons.Label({text: "Suser"}), template: oControl, sortProperty: "Button", filterProperty: "Button", name: "password_colonne"})); oControl = new sap.ui.commons.TextView({text:"{suser_mdp}"}); oTableSuser.addColumn(new sap.ui.table.Column({label: new sap.ui.commons.Label({text: "suser_mdp"}), template: oControl, sortProperty: "suser_mdp", filterProperty: "suser_mdp", visible: false})); var oModel = new sap.ui.model.json.JSONModel(); oModel.loadData("suser.php"); oTableSuser.setModel(oModel); oTableSuser.bindRows("/"); function openDialog(index) { var currentRowContext = oTableSuser.getContextByIndex(index); var valeur_suser_mdp = oModel.getProperty("suser_mdp",currentRowContext); alert(index); alert(currentRowContext); alert(valeur_suser_mdp); oTableSuser.getColumns()[1].setVisible(true); }; oTableSuser.placeAt("suser"); </script> I would like to retrieve the index of the row when I call the function function() {openDialog(oTableSuser.getSelectedIndex());} I tried different things and I didn't find how to retrieve the index of the row, I always have "-1" If someone has an idea I'm interested? Thx
  11. hi i have a drop down(<select>) in html. but what i need is, the user need to type in the drop down. When user types the first letter it has to display values which starts with that letter so selection will be easy. how can i achieve this? the drop down in html does not allow user to type in the letters so how can i achieve this? Looking out for a simple and solid solution? This requirement is there in many places so kindly help me?
  12. Hello everyone I have now worked on this trying several options for hours, I have tried tinyMCE.get('.content').getContent(); and regular jquery $('.content').val(); but it still won't work for me. I like the new look of the simple version of tinyMCE so I hope I won't have to give it up just yet! I'm retriving it for saving as: var content = $('.content').val(); I tried to retrive the data from the iframe that tinyMCE makes itself, but that would not work either.. But I might have done it wrong. Hope someone can help me out! Kris
  13. I want to be able to use the current date to solve a math problem, specifically as follows:If today is March 17, the math problem of the day should be:(Month times Day of Month) + 99 = Answer of the Day(3 x 17) + 99 = 150How can I create a java script to find the current month and the current day of month, multiple those two together, then add 99 and display the answer as a result. Ideally I'd like to embed this into an existing simple html page by referencing the JavaScript "math problem" so when "index.html" is opened, I have a line that shows immediately: "The answer of the day is: X" (or 150 today, etc). Thank you -- JB
  14. I Am Creating A iOS WebApp [ StandAlone] Which Looks Like A iOS Application The Only Difference That It Written In HtmlAnd JavascriptWhen You Go To A Website and click on add to home screen it creates an icon with the site content [webclip] i have created a website and i need help with one little detail i found that script in my site it permit all links to open in the webapp i was trying to make the links open in safari but when i manage to do that, the navigation menu doesn't work could any one help me please ?heres the code Detect if iOS WebApp Engaged and permit navigation without deploying Safari (function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(d.href.indexOf("http")||~d.href.indexOf(e.host))&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone") i need to open the links in safari rather than the webapp thats it
  15. I have Two gridviews on single ASPX page. after clicking linkbutton on 1st gridview second grid will display. and on that grid, I have another linkbutton which will open a new window using javascript. my problem is, after opening new window my aspx page does postback which I don't want. so I decided to use return false in javascript function Javascript Function ------------------------- function show_windowResCAdetails(deptname) { var url1; var complaintno = document.getElementById("HiddenField2").value; url1 = "viewResCallActionDetails.aspx?deptname=" + deptname +"&complaintno=" +complaintno vWincal1 = window.open(url1, "Responsible_CallActions", "width=730,height=350,status=no,resizable=yes,top=230,left=175,scrollbars=1"); return false; } Design Page(Template inside Gridview) -------------------------------------------------- <asp:TemplateField HeaderText="Dept Name"> <ItemTemplate> <asp:LinkButton ID="lnkResDept" Text='<%#bind("deptnm")%>' OnClick="lnkResdept_Click" OnClientClick='<%#"show_windowResCAdetails(""" + Eval("deptnm") + """);return false;"%>' runat="server"></asp:LinkButton> </ItemTemplate> </asp:TemplateField> here you can see that I have used return false two times in javascript function as well as on inline design. when i have tried to remove any of the return false; then aspx page will remain doing postback. but when i use both my problem solves. i don't understand how it is working. regards, Rhishikesh
  16. Hello, I'm working in a website development with django and I need to send a parameter to a script. On my web, I send parameters through the URL on this way: I put the href in which {{obra.id}} is the object received from views.py href="/edicionobra/obra{{obra.id}}/"> At the url I take that object as parameter to go to one page or another, according its value, url(r'^edicionobra/obra(?P<id_obra>.*)/$','demo.apps.obras.views.EdicionObra', name='edicionobra'), However, I would like to take that parameter to use it in a script, but I don't know how to do it. Would anybody know how to solve this? Thank you very much!
  17. I am new at coding, I only know some things about javascipt and html/css. Right now I am trying to create a simple cash register on codecademy. On javascript I have a prompt and when I type in "eggs" for example, it is supposed to console the price of eggs to the console, but nothing shows up. Here is my html code: <!DOCTYPE html><html><head> <link rel='stylesheet' href='style.css'/> <script src='script.js'></script></head><body> <div class="header"> </div> <div class="left"> </div> <div class="footer"> </div> <div class="right"> <button style="font-family: corsiva; font-size:20; border:1px solid black; border-radius: 100%;" onclick="buyItem()">What item do you want to buy?</button> </div></body></html> Here is my javascript: function add(){ console.log();};function item(name,price){ this.name = name; this.price = price;};var milk = new item("milk",2.89)var eggs = new item("eggs",172)var candybar = new item("candy bar",0.87)var soda = new item("soda",1.99)var water = new item("water",1.29)var cereal = new item("cereal",1.87)var donut = new item("donut",1.09)var chips = new item("chips",1.99)var magazine = new item("magazine",2.79)var nwspaper = new item("newspaper",0.99)var bagel = new item("bagel",0.99)var fruit = new item("fruit",1.99)var cgrtts = new item("cigarettes",5.99)function buyItem() { var buy = prompt("What item do you want to buy?").toLowerCase(); switch(buy){ case 'milk': console.log(milk.price);break; case 'eggs': console.log(eggs.price);break; case 'candy bar':console.log(candybar.price);break; case 'soda':console.log(soda.price);break; case 'water':console.log(water.price);break; case 'cereal':console.log(cereal.price);break; case 'donut':console.log(donut.price);break; case 'chips':console.log(chips.price);break; case 'magazine':console.log(magazine.price);break; case 'newspaper':console.log(nwspaper.price);break; case 'bagel':console.log(bagel.price);break; case 'fruit':console.log(fruit.price);break; case 'cigarettes':console.log(cgrtts.price);break; default: console.log("We do not sell that item!"); }} Can you tell me what is wrong with my code? Here are my two questions: 1. How do I console the price of an item to the log? 2. How do I direct what I want to console to a certain div? 3. Is there anything messed up with my code? Thank you so much for helping! P.S. Don't make fun of me I am not that good yet P.S. P.S. I also have a stylesheet but didn't think it was necessary to mention.
  18. The typit example for getElementsByName, http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_doc_getelementsbyname could be improved by picking the "value" instead of the "tagName". Both tagnames are "input", which makes it a dull example. Keep up the good work. Dave
  19. I have created a Websocket between my webpage and a application acting like a server on my computer. And the program is sending data though the Websocket, but i am trying to display it. When i open the page in the Chrome Developers Tools i get this. {"message":"SIMCONNECT_RECV_ID_SIMOBJECT_DATA","value":{"COM1_A":128.250000,"COM1_S":128.300003,"COM2_A":127.800003,"COM2_S":127.900002,"NAV1_A":108.500000,"NAV1_S":117.199997,"NAV2_A":110.599998,"NAV2_S":116.800003,"ADF1_A":284.000000,"ADF2_A":240.000000,"XPDR_A":4608}} Now im trying to figure out how to display the data into a div on my webpage. The old way i was displaying it was this way. Javascript jqXHR = $.getJSON("http://" + location.hostname + "/add_definition?definition_name=RADIO&name=COM1_A&PropertyName=COM ACTIVE FREQUENCY:1&UnitName=MHz&DatumType=FLOAT32", function(dane) {});jqXHR = $.getJSON("http://" + location.hostname + "/get?definition_name=RADIO", function(data){definition_data = data;});if (definition_data == undefined)return;var C1A = document.getElementById("COM1A");C1A.innerHTML = definition_data.COM1_A.toFixed(3); HTML <div class="DISP1" id="COM1A" type="button" name="COM1A" onclick="SETFREQ('com1_swap',1)">XXX.XXX</div> Im not sure how to display the data from the message into my page to display.
  20. Hey all!A bunch of us have been putting together a web-based drawing app. In a nutshell, users connect in real-time to draw or chat on a sort of interactive whiteboard. Plenty of these are made in Flash, but we are determined to build it in JavaScript and HTML5; a site that immediately works on mobile (because it's not Flash), tailors to everybody from drawing tablet users to people who want to screw around, chat and play games — and with an awesome, modern look that other apps lack. The thing that works so well is these kinds of programs give you a lot of freedom of expression that I think by making more accessible we can popularize, and truly get a future-proof, lasting community going.Current drawing apps aren't too popular as they're not accessible to the host of many devices people use, chatting's not versatile or user-friendly enough to compete with chat sites, and their designs look god-awful like it's still the 90's. So with what we're after, there's insane potential in this project. This is the interface. I hope it gives you some sense of what we're aspiring for. It's predominantly HTML, CSS, and JS with server-client communication in HTML5's WebSockets, and some points in PHP. If you're good with any of these, message me here, Skype drawplanet or email form@drawplanet.net. I'll be more than happy to answer any questions. And if you're critical of anything, nothing's set in stone. It's very much a by the community, for the community type of project. Also on the hunt for people good with P2P networking, node.js, SQL, or server management.
  21. function getXMLHttp(){ var xmlHttp; try { //Firefox, Opera 8.0+, Safari xmlHttp = new XMLHttpRequest(); } catch(e) { //Internet Explorer try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { alert("Your browser does not support AJAX!") return false; } } } return xmlHttp;}function populateEntries(menu, userName, entryRow){ var xmlHttp = getXMLHttp(); xmlHttp.onreadystatechange = function() { if ((xmlHttp.readyState == 4) && (xmlHttp.status == 200) && (xmlHttp.responseText == "")) { window.alert("There are no records to view!"); } else if ((xmlHttp.readyState == 4) && (xmlHttp.status == 200)) { var response = xmlHttp.responseText;// window.alert("PHP Response = '"+response+"'"); } } xmlHttp.open("GET", "getUsers.php", true); xmlHttp.send(null);// ADDITIONAL UNRELATED CODE THAT PARSES THE “RESPONSE,” CREATING A MULTIDIMIENSIONAL ARRAY, WHICH POPULATES A SELECT INPUT FOLLOWS ....} I am using an AJAX call from a javascript to populate a SELECT input. This script is not working as shown in the code excerpt below. However, when I insert an alert of any type at the location shown by the comment, it works as planned. What could be causing this? I've also tried, without success, inserting a delay function after the AJAX call to allow time for the response to be returned (even with the readystate and status tests shown). Any suggestions as to how I can get this to work as desired?
  22. Ok, Hi everyone. I found this awesome and simplistic shopping cart on codepen.com BUT I do not know how to make it work .... :(TO begin with here is the link for it: http://codepen.io/bartveneman/details/KHxLGI am using Dreamweaver to make my website. So I copied it all, made sure that the links between my html, css and js are working fine and it still does not work. My problem with it is as follows: I did a copy+paste on it cannot shows me the cart without any items. I do not know how to add items without ruining the JS which will calculate things like total price, subtotal, etc. Things that I tried [ if you know exactly what I need to do don't bother reading what I tried, I am a beginner anyways ] I tried replacing inside the HTML the places where it says things like "src="{{=img}}" I would replace it the source with an actual source path for an image which works but shows nothing at all. I tried then also here in the HTMl file to simply take the tag off. As you see the html is based on one top part which is a big tag then is has the footer. The items are inside the tag at the top, BUT the tag is enclosed within some script tag so I removed the script and it shows one item ok-ish. The problem with this is that it would function with the script. For example it shows the item now but I cant add it to cart anything. Lastly, I looked inside the JS file and I found the section with the app variable which seems to have the details for the items included in the example. I changed those but nothing shows... So I tried some basic stuff. If anybody can help me with this by the end of the weekend it would be great !
  23. I saw in W3Schools website that the amount is in USD (not in Indian currency). Can you tell me the amount in Indian currency (INR) and how I can pay for this exam from India? Thanks, Arnab Roy Chowdhury
  24. <?php$salename=json_encode($oSales);?> I need pass variable in php script to javaScript code in series <script type="text/javascript"> $(function () {$('#lineChartSales').highcharts({chart: {type: 'line'},title: {text: 'Monthly Average Sales'},xAxis: {categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']},yAxis: {title: {text: 'Temperature (°C)'}},plotOptions: {line: {dataLabels: {enabled: true},enableMouseTracking: true}},series: [{name:a,data: [1, 6.9, 9.5, 14.5, 18.4, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]},{name: b,data: [3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8]}]});});</script> Any help Thanks
  25. I was wondering if javascript or jquery could change the look of a CSS class in a function called by a onclick(). For example I have a #first and also a .unclicked and .clicked. And i have a input type="button" id="first" class="unclicked" onclick="function()". function(){ change class from unclicked to clicked on first then some other code } Inside the function how do i change the class from unclicked to clicked. I know you haft to use the document.getid(first).style, but I'm not sure how to get the function to change it.
  • Create New...