Jump to content

Search the Community

Showing results for tags 'JAVASCRIPT'.

The search index is currently processing. Current results may not be complete.
  • 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. Hi all, I am a beginner in HTML5. I need to play a video using my custom mediaplayer which is residing on the client-side. Mediaplayer is written CPP and Qt. Is there any way I can invoke the mediaplayer from the html 5 page? If object or embed tag is to be used, how do I specify the external application on client-side? How to control the function in javascript? (Video tag support is not provided on my target machine)Please help...
  2. Hi, I am creating a validation for gridview row Selection. There is a "Delete" button and a GridView, in that GridView, there is a "Select" LinkButton column. I am trying to create a validation for that, When clicking on the "Delete" Button, If the particular row in GridViewis not selected for deleting, then it should show a alert message i.e. "First select any row to delete." So I wrote a code for the validation: <script type="text/javascript"> function validateGridSelection() { var GridSelectedID = document.getElementById('<%=GridView1.ClientID%>'); if (GridSelectedID.rows.selectedIndex = -1) { alert("First select any row to delete"); return false; } } </script> But this JavaScript is not working for this validation. So, Please help me out to sort out this problem. Thanks.
  3. <html> <head> <title>Port Scanner for Mozilla Firefox</title> </head> <body> <form name="my_form" id="my_form" method="post" action="#" onsubmit="return displayMessage();"> <p align="center">URL/Domain Name/IP Address: <input type="text" size="20" name="uri" value="" placeholder="http://www.google.com" required/></p> <table align="center" border="1" width=100% bgcolor="#f4fff0" bordercolor="green" cellspacing="2" cellpadding="2"> <tr> <td align="center"> Start port: <input type="text" size="5" name="start_port" maxlength="5"> End port: <input type="text" size="5" name="end_port" maxlength="5"><br> <input type="submit" value="Scan all ports" name="scan_all"><br> <input type="submit" value="Scan only open ports" name="scan_open"> </td> </tr> <tr> <td align="center"> <input type="text" size="20" name="scan_tcp"><br> <font color="#b1b1b1">Enter port numbers separated by space. (e.g. 21 25 80)</font><br> <input type="submit" value="Scan TCP ports" name="scan_tcp_ports"> </td> </tr> <tr> <td align="center"> <input type="submit" value="Scan common service ports" name="scan_common_tcp"><br> <input type="submit" value="Scan common Trojan ports" name="scan_common_trojan_tcp"> </td> </tr> </table> </form> <script type="text/javascript"> function displayMessage() { if(document.my_form.uri.value==0) { document.write("<font color='red'><i>Please enter URL/Domain Name/IP Address.</i></font>"); return false; } document.write("<DIV id='loading'><BR><BR><font color='#FF6600'><i>Please wait... The ports are being scanned...</i></font></DIV>"); document.getElementById("my_form").submit(); } window.onload=function() { document.getElementById("loading").style.display="none"; } </script> </body> </html> I want to submit above form. But it shows me JavaScript error in Console that "TypeError: document.getelementbyid(...) is null" This error is for code : document.getElementById("my_form").submit(); I am using Firefox 24.0 and Windows 7. I have installed only 1 add-on. That is 'Firebug 1.12.3'. This code works fine for other browsers Except Firefox. Please help me to solve this problem.
  4. I just built out a website for a client using a template from egrappler.com and I have encountered a spacing issue that I cant figure out for the life of me. For some reason, my image slider has been pushed to the right by 40px and I cant figure out why or how. Here is how it is supposed to look: http://screencast.com/t/pKQAAHEge Here is how it looks: http://screencast.com/t/TYkLqNWkp The URL is http://www.casablancapm.com Any help on this is GREATLY apreciated! It's driving me CRAZY!
  5. Hi, I'm having a glitch when testing the compatibility of my site in IE10. It works just fine in FF, safari and chrome on my macs, iPad and windows laptop. But my jquery navigation menu and fancybox image gallery just don't work.My site is under development and seems to be just dandy on all browsers except for IE10.:For some reason the menu bar and photo gallery, which are both powered by Jquery just dont work. I've noticed when I removed the fancybox scripts for my other pages the menu behaves but on my homepage in testing on IE10 on windows 8 it's not right. I also tried to link my jquery to the latest version on Google but all that seems to do is break my scripts in all browsers.Can anyone shed any light on this for me..., I've tried everything aside from going fxxk u to IE. I hate papering over problems, I like to resolve them...Here is my code:Code:<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script><script type="text/javascript" src="jQuery Sliding Flexible Menu v2/deploy/js/jquery.sliding-flexible-menu-v2.js"></script><script src="SpryAssets/SpryEffects.js" type="text/javascript"></script><link rel="stylesheet" type="text/css" href="jQuery Sliding Flexible Menu v2/deploy/css/sliding-flexible-menu-v2.css"><script type="text/javascript">$(document).ready(function() { //Horizontal $("div.menu-horizontal").slidingFlexibleMenuv2({ buttonSpacing: '1' }); $(".fancybox").fancybox( { transitionIn : 'elastic',transitionOut : 'elastic',easingIn : 'easeOutBack',easingOut : 'easeInBack',speedIn : '650',speedOut : '650',changeSpeed : '650', padding : '0px', });});function MM_effectAppearFade(targetElement, duration, from, to, toggle){ Spry.Effect.DoFade(targetElement, {duration: duration, from: from, to: to, toggle: toggle});}</script><script type="text/javascript" src="fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.pack.js"></scr ipt><link type="text/css" rel="stylesheet" href="fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.css">`Anyone got a clue why this aint working in IE????Full site herehttp://www.heggie5.webspace.virginmedia.comCheers
  6. Hi All, i'm doing sample ajax exercise and getting the response from server but the response work fine in IE browser but not in firefox/chrome browser. below is the code snippet also find the snippet ========================= ajaxdemo.html =========================l <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> <input type="text" id="inputDisplay" /> <button type="button" onclick="sendMessageToServer()">Send To Server</button><br/> <input type="text" id="textDisplay"/> <script type="text/javascript"> var xmlhttp; if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else if (window.ActiveXObject) { isIE = true; xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } function sendMessageToServer() { xmlhttp.open("POST","/LabAjax04/AjaxDemoServlet?name="+document.getElementById("inputDisplay").value,true); xmlhttp.onreadystatechange=receiveMessageFromServer; xmlhttp.send(); document.getElementById("inputDisplay").value=''; } function receiveMessageFromServer() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { alert(xmlhttp.responseXML.getElementsByTagName("responseFromServer")[0].text);// displays undefined alert(xmlhttp.responseText);//display the response from server document.getElementById("textDisplay").value=xmlhttp.responseXML.getElementsByTagName("responseFromServer")[0].text; } } </script> </body> </html> ======================= java file ====================== package com.sample.ajax; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * Servlet implementation class AjaxDemoServlet */ public class AjaxDemoServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public AjaxDemoServlet() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {} /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("server recived the folwwoing messgae from client:"+request.getParameter("name")); response.setContentType("text/xml"); response.getWriter().println("<responseFromServer>"+request.getParameter("name")+"</responseFromServer>"); System.out.println("server replied with the folwwoing messgae to client:"+request.getParameter("name")); } } ========= web.xml ========= <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>LabAjax04</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <servlet> <description></description> <display-name>AjaxDemoServlet</display-name> <servlet-name>AjaxDemoServlet</servlet-name> <servlet-class>com.sample.ajax.AjaxDemoServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>AjaxDemoServlet</servlet-name> <url-pattern>/AjaxDemoServlet</url-pattern> </servlet-mapping> </web-app> Thanks in advance!!!
  7. Hi before adding <!DOCTYPE html > to my html, my javascript code is working fine. But by adding this to my html, the below part of the code is not working div.style.left=x;div.style.top=y; i am not able to set left and top values to an element. What could be the problem?
  8. Hello! I'm trying to make a word game in HTML, using javascript and css. I took 1000 different words and put them on a txt file. Every time game starts I want to take only one word (randomly) and mix it's letters. I got stuck with reading these words separately from this txt file. I thought about using javascript, but I'm not sure how to take only one word from this file. Does anyone know how to do this the easiest way? I'm not so good at programming (yet). Thanks!
  9. Stripe has an easy pay with card button. I want to hack it so I can pass a custom amount to it. (It defaults to 20)The site currently under construction is http://pecosselfstorage.com/testpayments.htmlI need the customer to be able to put in however much they want to pay. Whether this is in the pop-up after they click the button, or on the page next to the button doesn't matter much. I'd prefer it to be in the pop-up however.Please don't just post links to Stripe's site, I've been through all of that and can't find any help there.Any thoughts are welcome. Thanks!
  10. forms.js.txtform.txtMailHandler.php.txt I am a photographer with a strong design and coding background trying to make myself a new website.I'm trying to tweak a template to suit my needs, and I am having considerable trouble with the Contact Form page. I am very familiar with html and css, but js is not my strong suit and I have never worked with php before. If anyone could help me by letting me know where/what I need to edit for the submit button to make the form information go to my email I would greatly appreciate it. I have tried editing what I thought was right, and it still doesn't work. I have given up on my edited files and reverted back to the original template files because I'm sure the files I have been editing are beyond repair at this point. I really need to get this site up and running ASAP, but I am at my wits end with this form. Everything else on the form seems to work fine. These are my thoughts: [*] [*]The action element of the form tag is set to "#". That's not right, but I'm not sure what to put there. And there is no method element.[*] [*]The owner-email on the .js page is also set to #, so I'm sure I need to put in the email address there. I'm just not sure about the syntax.[*] [*]There is also a spot in the .php file that I feel needs to have my email address also, but again, I'm unsure of the syntax. [*] [*]Also the a tag href element on the submit button is also set to "#" and I'm not sure where to point it, because it appears that the form should give the user a .js message confirming that the form has been sent...[*] This is the form code in the html file: <h2>Contact form</h2><form action="#" id="ContactForm"><div class="success"> Contact form submitted!<br><strong>We will be in touch soon.</strong> </div><fieldset><div class="wrapper"><span class="col1">Name:</span><label class="name"> <span class="bg"><input type="text" class="input"></span><span class="error">*This is not a valid name.</span> <span class="empty">*This field is required.</span> </label></div><div class="wrapper"><span class="col1">Email:</span><label class="email"><span class="bg"><input type="text" class="input"></span><span class="error">*This is not a valid email address.</span> <span class="empty">*This field is required.</span> </label></div><div class="wrapper"><span class="col1">Message:</span><label class="message"><span class="bg"><textarea rows="1" cols="1"></textarea></span><span class="error">*The message is too short.</span> <span class="empty">*This field is required.</span> </label> </div><div class="btns"><a href="#" class="button1" data-type="submit">Send</a><a href="#" class="button1" data-type="reset">Clear</a></div></fieldset></form> This is the forms.js file: //forms;(function($){$.fn.forms=function(o){return this.each(function(){var th=$(this),_=th.data('forms')||{errorCl:'error',emptyCl:'empty',invalidCl:'invalid',notRequiredCl:'notRequired',successCl:'success',successShow:'4000',mailHandlerURL:'bin/MailHandler.php',ownerEmail:'support@guardlex.com',stripHTML:true,smtpMailServer:'localhost',targets:'input,textarea',controls:'a[data-type=reset],a[data-type=submit]',validate:true,rx:{".name":{rx:/^[a-zA-Z'][a-zA-Z-' ]+[a-zA-Z']?$/,target:'input'},".state":{rx:/^[a-zA-Z'][a-zA-Z-' ]+[a-zA-Z']?$/,target:'input'},".email":{rx:/^(("[w-s]+")|([w-]+(?:.[w-]+)*)|("[w-s]+")([w-]+(?:.[w-]+)*))(@((?:[w-]+.)*w[w-]{0,66}).([a-z]{2,6}(?:.[a-z]{2})?)$)|(@[?((25[0-5].|2[0-4][0-9].|1[0-9]{2}.|[0-9]{1,2}.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2}).){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})]?$)/i,target:'input'},".phone":{rx:/^+?(d[d-+() ]{5,}d$)/,target:'input'},".fax":{rx:/^+?(d[d-+() ]{5,}d$)/,target:'input'},".message":{rx:/.{20}/,target:'textarea'}},preFu:function(){_.labels.each(function(){var label=$(this),inp=$(_.targets,this),defVal=inp.val(),trueVal=(function(){var tmp=inp.is('input')?(tmp=label.html().match(/value=['"](.+?)['"].+/),!!tmp&&!!tmp[1]&&tmp[1]):inp.html()return defVal==''?defVal:tmp})()trueVal!=defVal&&inp.val(defVal=trueVal||defVal)label.data({defVal:defVal}) inp.bind('focus',function(){inp.val()==defVal&&(inp.val(''),_.hideEmptyFu(label),label.removeClass(_.invalidCl))}).bind('blur',function(){_.validateFu(label)if(_.isEmpty(label))inp.val(defVal),_.hideErrorFu(label.removeClass(_.invalidCl)) }).bind('keyup',function(){label.hasClass(_.invalidCl)&&_.validateFu(label)})label.find('.'+_.errorCl+',.'+_.emptyCl).css({display:'block'}).hide()})_.success=$('.'+_.successCl,_.form).hide()},isRequired:function(el){ return !el.hasClass(_.notRequiredCl)},isValid:function(el){ var ret=true$.each(_.rx,function(k,d){if(el.is(k))ret=d.rx.test(el.find(d.target).val()) })return ret },isEmpty:function(el){var tmpreturn (tmp=el.find(_.targets).val())==''||tmp==el.data('defVal')},validateFu:function(el){ el.each(function(){var th=$(this),req=_.isRequired(th),empty=_.isEmpty(th),valid=_.isValid(th) if(empty&&req)_.showEmptyFu(th.addClass(_.invalidCl))else_.hideEmptyFu(th.removeClass(_.invalidCl)) if(!empty)if(valid)_.hideErrorFu(th.removeClass(_.invalidCl))else_.showErrorFu(th.addClass(_.invalidCl)) })},getValFromLabel:function(label){var val=$('input,textarea',label).val(),defVal=label.data('defVal') return label.length?val==defVal?'nope':val:'nope'},submitFu:function(){_.validateFu(_.labels) if(!_.form.has('.'+_.invalidCl).length)$.ajax({type: "POST",url:_.mailHandlerURL,data:{name:_.getValFromLabel($('.name',_.form)),email:_.getValFromLabel($('.email',_.form)),phone:_.getValFromLabel($('.phone',_.form)),fax:_.getValFromLabel($('.fax',_.form)),state:_.getValFromLabel($('.state',_.form)),message:_.getValFromLabel($('.message',_.form)),owner_email:_.ownerEmail,stripHTML:_.stripHTML},success: function(){_.showFu()}}) },showFu:function(){_.success.slideDown(function(){setTimeout(function(){_.success.slideUp()_.form.trigger('reset')},_.successShow)})},controlsFu:function(){$(_.controls,_.form).each(function(){var th=$(this)th.bind('click',function(){_.form.trigger(th.data('type'))return false})})},showErrorFu:function(label){label.find('.'+_.errorCl).slideDown()},hideErrorFu:function(label){label.find('.'+_.errorCl).slideUp()},showEmptyFu:function(label){label.find('.'+_.emptyCl).slideDown()_.hideErrorFu(label)},hideEmptyFu:function(label){label.find('.'+_.emptyCl).slideUp()},init:function(){_.form=_.me _.labels=$('label',_.form) _.preFu() _.controlsFu() _.form.bind('submit',function(){if(_.validate)_.submitFu()else_.form[0].submit()return false}).bind('reset',function(){_.labels.removeClass(_.invalidCl) _.labels.each(function(){var th=$(this)_.hideErrorFu(th)_.hideEmptyFu(th)})})_.form.trigger('reset')}}_.me||_.init(_.me=th.data({forms:_}))typeof o=='object'&&$.extend(_,o)})}})(jQuery)$(window).load(function() { $('#ContactForm').forms({ownerEmail:'#'})}) And this is the mailhandler.php file: <?php$owner_email = $_POST["owner_email"];$headers = 'From:' . $_POST["email"];$subject = 'A message from your site visitor ' . $_POST["name"];$messageBody = ""; if($_POST['name']!='nope'){$messageBody .= '<p>Visitor: ' . $_POST["name"] . '</p>' . "n";$messageBody .= '<br>' . "n";}if($_POST['email']!='nope'){$messageBody .= '<p>Email Address: ' . $_POST['email'] . '</p>' . "n";$messageBody .= '<br>' . "n";}else{$headers = '';}if($_POST['state']!='nope'){ $messageBody .= '<p>State: ' . $_POST['state'] . '</p>' . "n";$messageBody .= '<br>' . "n";}if($_POST['phone']!='nope'){ $messageBody .= '<p>Phone Number: ' . $_POST['phone'] . '</p>' . "n";$messageBody .= '<br>' . "n";} if($_POST['fax']!='nope'){ $messageBody .= '<p>Fax Number: ' . $_POST['fax'] . '</p>' . "n";$messageBody .= '<br>' . "n";}if($_POST['message']!='nope'){$messageBody .= '<p>Message: ' . $_POST['message'] . '</p>' . "n";} if($_POST["stripHTML"] == 'true'){$messageBody = strip_tags($messageBody);} try{if(!mail($owner_email, $subject, $messageBody, $headers)){throw new Exception('mail failed');}else{echo 'mail sent';}}catch(Exception $e){echo $e->getMessage() ."n";}?> Any help would be greatly appreciated!
  11. Hello, I am writing a code that allows user create item, select amount to be created, name it and choose a color for it. I have a global counter that is supposed to keep count of items created and also give each item create unique id. The issue is when i click to create item, the ids do not increment. How do i increment counter, save items in array and reset counter? This is what i have tried. var items = []; window.onload = init; var counter = 0; var radioButton = 0; function init() { var create = document.getElementById("create"); create.onclick = create; } function create() { var nameInput = document.getElementById("name"); var name = nameInput.value; var colorSelect = document.getElementById("color"); var colorOption = colorSelect.options[colorSelect.selectedIndex]; var color = colorOption.value; if (name == null || name == "") { alert("please enter a name"); return; } for (var i = 0; i < data.elements.amount.length; i++) { if (data.elements.amount.checked) { var amount = data.elements.amount.value; } } for (radioButton = 0; radioButton < amount; radioButton++) { var div = document.getElementById("arena"); var div = document.createElement("div"); var newId = div; newId = radiobutton; div.id = newId; div.name = name; } This is the HTML for to create item <ol> <li>How many items do you want to create?<br> <input type="radio" id="four" name="amount" value="4"> <label for="five">4</label><br> <input type="radio" id="eight" name="amount" value="8"> <label for="ten">8</label><br> <input type="radio" id="twelve" name="amount" value="12"> <label for="fifteen">12</label><br> </li> </ol> Thanks in advance for your help
  12. hi i have seen a code snippet on some site. It says with the following code snippet we can find the browser manufacturer. if (jqcc.browser.msie) {//it is IE}; My confusion is about "jqcc". what is "jqcc"?
  13. Hai Guys,This is my work about drag and drop using HTML5 Before drag and Drop: http://cl.ly/image/0O3w2y1k0U3b After drag and drop: http://cl.ly/image/0C210U3m0d0Z I have 2 area, black area and White area, in which white area is area to drop. After drag and drop, i have problem that copy images(in white area) can't move/drag in white area... This is my Javascript code : http://cl.ly/image/3J1u101p0S1eMy HTML5 code: http://cl.ly/image/2z041f240f3UMy Questions is How to move the copy images after drag and drop in white area? this is to aim get functionality like modeling tool UML
  14. Into a php page I have 20 text boxes. I want to make a button, using javascript, and when user clicks on it the rest 19 text boxes to take 1st text box's text. I have done something like this but it isn't working... Any idea??? function Throw_PhotoStuff(){var pcount=1; while(pcount<20;){document.getElementById('photo_'+pcount).value = document.getElementById('photo_1').value; pcount++;}} Thank you for your precius time!!!
  15. Hi I have 5 div tags in my html page and there is a print button. when i click on the print button it has to print only a particular div. for example it has to print the 2nd div which contains some personal information. It should not print the rest of the page. Only the content of the 2nd div should be printed. how to achieve this?
  16. I want add images to my lightbox2 gallery using javascript links. for example, I tried, <script>imageArray =["image1.jpg","image2.jpg","image3.jpg"];function assignUrl(img_num){return "www.website/images/" + imageArray[img_num];}</script> And in my gallery, I used, <a href="javascript:document.location.href=assignUrl(0);" data-lightbox="imagegallery" ><img src="javascript:document.location.href=assignUrl(0);" <!-- thumbnail--> </a> But it doesn't work.. The thumbnail doesn't show, and when u click, the image keeps loading but nothing happens. When I use a test link like this, It displays the image. <a href="javascript:document.location.href=assignUrl(0);"> TEST </a> Please help? what am I doing wrong? Is there any other workaround this?
  17. Good day, I appreciate that this is a popular query but I've been searching the web for answers and I've been unable to get my code to work. I'm trying to create the effect of an animated button on a website. I have a div which contains an <img/>. This image is the "animated button". I have already prepared the additional images to represent the following frames. Now, the JavaScript code I have (which I've pulled together looking at examples) is below. var navAniButton;var aniImgs;var imgAniTimer;var index;var maxImages; function updateVar() {navAniButton = document.getElementById("navAniButton");aniImgs = ["images/Frame1.png", "images/Frame2.png", "images/Frame3.png", "images/Frame4.png", "images/Frame5.png", "images/Frame6.png", "images/Frame7.png", "images/Frame8.png"];imgAniTimer = setInterval(changeAniImg(), 500);index = 0;maxImages = aniImgs.length - 1;} function changeAniImg() {var curAniImg = aniImgs[index];index = (index == maxImages) ? 0 : ++index;navAniButton.src =curAniImg;} The updateVar(); function is called in the body "onload" to update the global variables. When the page is loaded the image src is loaded correctly and then it appears that the JavaScript attempts to change the src, because the image changes to a cross (you know, as if it can't locate the file). But, I can't figure out why it does this. I've opened the debugger and, originally, it advised that the maxImages variable had not been defined. It hadn't. So, I amended that, but now I'm not receiving any errors in the console. I apologise if I've missed something extremely obvious or if I'm omitted something that would help you all out. Let me know if I can help at all.
  18. Hi, i was wondering how to move a image over a 9x9 grid of other images The 9x9 would be 81 images of a size, lets say 32px by 32px The images that moves over them the same size 32x32. The 9x9 would be the background and the image that needs to be moved should stay centered. In what direction should i look, and are there any tutorials on the mather ? i was thinking that if i move the background the image would always stay centered but i dont know i that is a good idea. an exemple would be http://www.pardus.at or http://sylfex.redirectme.net
  19. it is main file retrive here data of drop down but not retrive data ? not display country in the select list so plaese help me it is main.php <!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></head><body> <table><tr><td>Country </td><td><select name="country" id="country" onchange="getState(this.value)"><option value="-1">Select Country</option><?php$cntry = mysql_query("SELECT `Country_Id`, `name` FROM country ORDER BY `name` ASC");while($row = mysql_fetch_assoc($cntry)){echo '<option value="'.$row['Country_Id'].'">'.$row['name'].'</option>';}?></select></td></tr><tr><td>State </td><td>: <select name="state" id="state" onchange="getCity(this.value)"><option value="-1">Select State</option></select></td></tr><tr><td>City </td><td>: <select name="city" id="city" ><option value="-1">Select City</option> </select></td></tr></table></body></html>
  20. Is there anyone that write me a javascript code that will display a certain message based on what time of day it is and what day of the week it is. I run a radio stations website and they want to put up a schedule of their on-air staff and shows on their website.Here is a code i found that worked, but it's just time in general, not what day of the week. Also, how can I make it to get the time in a certain time zone? No message at the present timefunction show() {var nowhrs = new Date().getHours();var nowmins = new Date().getMinutes();var hrsmins = nowhrs + (nowmins/60); // decimals of an hourvar schedule = [['Message 1',[9],[18]], // times are expressed as hours + decimals of an hour, e.g. 30 minutes is .5 hours.['Message 2',[18],[21.5]],['Message 3',[19.5],[20.25]]]var themessage = "";for (var i =0; i = schedule[i][1]) && (hrsmins < schedule[i][2])) {themessage += schedule[i][0] + "";document.getElementById("mymessage").innerHTML = themessage;}}}
  21. I am new to W3Schools Forum and JavaScript. I have used a function toggleDiv(divId) for the next and previous buttons that show a table in 5 different divs on a PHP page. The buttons work. The problem is that at first all the div's show up on the page then switch to one at a time once the next button is pressed. How do I just call the first div id with a next button to the rest? Do I set up each div as a variable to be called from an array? I saw something about style="visibility: visible" or "hidden", but I don't know to make that work either. Here is some of what I have: <script type="text/javascript"> function toggleDiv(divId){ for(var i = 1; i < 6; i++) { var tempDivId = "graffiti" + i; document.getElementById(tempDivId).style.display='none'; } document.getElementById(divId).style.display='block'; return false; }</script> <div id="graffiti1"> <table id="tbl"> <tr> <td><img alt="..." src=".._Web.jpg" /><br >...</td> <td><img alt="..." s rc="A.._Web.jpg"><br >...</td> </tr> <tr> <td colspan="2"> <input type="button" id="btnnext1" value="Next" onclick="toggleDiv('graffiti2');" /> </td> </tr> </table> </div><div id="graffiti2"> <table id="tbl"> <tr> <td><img alt="..." src=".._Web.jpg"><br >...</td> <td><img alt="..." src=".._Web.jpg"><br >...</td> </tr> <tr> <td colspan="2"> <input type="button" id="btnnext2" value="Next" onclick="toggleDiv('graffiti3');" /></td> <td colspan="2"> <input type="button" id="btnprev1" value="Previous" onclick="toggleDiv('graffiti1');" /> </td> </tr> </table> </div> <div id="graffiti3"> <table id="tbl"> <tr> <td><img alt="..." src=".._Web.jpg"><br >...</td> <td><img alt="..." src=".._Web.jpg"><br >...</td> </tr> <tr> <td colspan="2"> <input type="button" id="btnnext3" value="Next" onclick="toggleDiv('graffiti4');" /></td> <td colspan="2"> <input type="button" id="btnprev2" value="Previous" onclick="toggleDiv('graffiti2');" /> </td> </tr> </table> </div>Thanks for any help.
  22. Hello Everyone, I am new JavaScript and would like to help my friend with her website. She wants the user to enter the data such as age and marital status. Check for a condition if the age is less than 25 and marital status is single she wants the user to see a specific message. In the same way if the age is more than 25 and status is single some other information. Can anyone please help me with it. Any help would be gratefully accepted.
  23. I currently have a javascript slider in place. It's on autoplay at 5 seconds per slide. The second slide has an iframe youtube video.Unfortunately, if I click play, 5 seconds later, the slider autplays to the next slide.Is there any way to get the slider to recognize the video is playing, for example? Or are there any other ways around this that anyone can think of?The JS code is simple, I'm using http://jquery.malsup.com/cycle/ for my slider. <script type='text/javascript'> jQuery('#slider-1').cycle({ next: '#next-1', prev: '#prev-1', fx: 'fade', timeout: 30000000, pause: 1, pager: '#slider-nav-pager-1', height: '433px', width: '960px' })</script>If you need more code, let me know. It's just a simple iframe.Thanks!
  24. var max = 2;var hatId = 32199211; function test(){var ifr = document.createElement('iframe');document.body.appendChild(ifr);ifr.id = "ok";var exp = document.getElementById('ok');exp = exp.contentWindow.document || exp.contentDocument;var p = exp.getElementsByTagName("pre"); for (var v=1; v<max; v++) { var url = "http://api.roblox.com/ownership/hasasset?assetId=" + hatId + "&userId=" + v + ""; ifr.src = url; console.log(ifr.src); for(var z=0; z<p.length; z++){ if (p[z].innerHTML == "true") { console.log(v); console.log("true"); } }}} var timer = setInterval("test()", 200); it won't stop logging, also i can't get it to log the url + value Uncaught TypeError: Cannot call method 'getElementsByTagName' of null 2 Blocked a frame with origin "chrome://newtab" from accessing a frame with origin "http://api.roblox.com". The frame requesting access has a protocol of "chrome", the frame being accessed has a protocol of "http". Protocols must match. Uncaught TypeError: Cannot call method 'getElementsByTagName' of null 2 Blocked a frame with origin "chrome://newtab" from accessing a frame with origin "http://api.roblox.com". The frame requesting access has a protocol of "chrome", the frame being accessed has a protocol of "http". Protocols must match. Uncaught TypeError: Cannot call method 'getElementsByTagName' of null
  25. Hello Guys, We are Software Engineers and Developers with across board knowledge in HTML, CSS, PHP, JAVASCRIPT and will be glad to take a look at any problems that you may be having with your site. You can email me if you want any help at all with your site. Cid Email
  • Create New...