Search Results

Search found 6478 results on 260 pages for 'hippy head'.

Page 63/260 | < Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >

  • Unable to register achievements

    - by abe
    I've been unable to register any achievements. I keep getting the following: {"error":{"message":"(#3502) Object at achievement URL is not of type game.achievement","type":"OAuthException","code":3502}} When I run my URL through the linter, I get: Open Graph Warnings That Should Be Fixed Inferred Property: The 'og:url' property should be explicitly provided, even if a value can be inferred from other tags. Inferred Property: The 'og:title' property should be explicitly provided, even if a value can be inferred from other tags. Although when I load the URL myself I clearly see those set in the meta tags. My HTML looks like: <html> <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# game: http://ogp.me/ns/game#"> <meta property="fb:app_id" content="<MY_APP_ID>" /> <meta property="og:type" content="game.achievement" /> <meta property="og:url" content="http://<MY_DOMAIN>/ach10.html" /> <meta property="og:title" content="Title" /> <meta property="og:description" content="Description" /> <meta property="og:image" content="http://placekitten.com/g/200/300" /> </head> <body> Hmm.. </body> </html> Also interesting, is the graph API sees it as: { "url": "http://<MY_DOMAIN>/ach10.html", "type": "website", "title": "http://<MY_DOMAIN>/ach10.html", "updated_time": "2012-03-09T19:49:14+0000", "id": "<ID>" } And the scraped URL returns nothing ... anyone have any ideas? I've also tried adding the Game Achievement object in the Open Graph settings and every combination of Sandbox Mode/Social Discovery enabled and disabled.

    Read the article

  • PHP Cookie Warning...

    - by Nano HE
    Hi,I am new to PHP, I practised PHP setcookie() just now and failed. http://localhost/test/index.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> </head> <body> <?php $value = 'something from somewhere'; setcookie("TestCookie", $value); ?> </body> </html> http://localhost/test/view.php <?php // I plan to view the cookie value via view.php echo $_COOKIE["TestCookie"]; ?> But I failed to run index.php, IE warning like this. Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\test\index.php:9) in C:\xampp\htdocs\test\index.php on line 12 I enabled my IE 6 cookie no doubt. Is there anything wrong on my procedure above? Thank you. WinXP OS and XAMPP 1.7.3 used.

    Read the article

  • adding an uncertain number of fields using javascript

    - by user306472
    I'm new to javascript and a novice programmer, so this might be a really easy question to answer. I would like to loop over the values of x number of fields and add them up to display the sum in a final field. I can perform this function if I explicitly call each field, but I want to abstract this so I can deal with a flexible number of fields. Here's example code I've come up with (that's not working for me). Where am I going wrong? <html> <head> <script type="text/javascript"> function startAdd(){ interval = setInterval("addfields()",1); } function addfields(){ a = document.addition.total.value; b = getElementByTagName("sum").value; for (i=0; i<=b.length; i++){ a+=i; } return a; } function stopAdd(){ clearInterval(interval); } </script> </head> <body> <form name="addition"> <input type="text" name="sum" onFocus="startAdd();" onBlur="stopAdd;"> + <input type="text" name="sum" onFocus="startAdd();" onBlur="stopAdd;"> = <input type="text" name ="total"> </form> </body> </html>

    Read the article

  • Chrome extension:Cannot call method 'getElementsByTagName' of null

    - by T_t
    Hi,i am beginner with chrome extension.There is simple problem. There is the code in my extension,but it do not work.I don't know how to figure it out. In my extension, i used a xml file to stroe some data.There is the code in my background.html,but it do not work,i don't know how to figure it out... <!DOCTYPE html> <html> <head> </head> <body> <script> function loadXmlFile(){ var xmlDom = null; var xmlhttp = new XMLHttpRequest(); if( xmlhttp ){ xmlhttp.onreadystatechange = function(){ if( xmlhttp.readyState == 4 ){ if( xmlhttp.status == 200 ){ xmlDom = xmlhttp.responseXML; } } } xmlhttp.open( "GET",chrome.extension.getURL("/xml/123.xml"),true); xmlhttp.send( null ); } return xmlDom; } var xmlDom = loadXmlFile(); var s = xmlDom.getElementsByTagName( "to" ); alert( s[0].nodeType ); </script> </body> </html> I used developer tools to debug,but it says " Cannot call method 'getElementsByTagName' of null"... who can help me?

    Read the article

  • document.write Not working when loading external Javascript source

    - by jadent
    I'm trying to load an external JavaScript file dynamically into an HTML element to preview an ad tag. The script loads and executes but the script contains "document.write" which has an issue executing properly but there are no errors. <html> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> <script type="text/javascript"> $(function() { source = 'http://ib.adnxs.com/ttj?id=555281'; // DOM Insert Approach // ----------------------------------- var script = document.createElement('script'); script.setAttribute('type', 'text/javascript'); script.setAttribute('src', source); document.body.appendChild(script); }); </script> </head> <body> </body> </html> I can get it to work if If i move the the source to the same domain for testing If the script was modified to use document.createElement and appendChild instead of document.write like the code above. I don't have the ability to modify the script since it being generated and hosted by a 3rd party. Does anyone know why the document.write will not work correctly? And is there a way to get around this? Thanks for the help!

    Read the article

  • functions with same names in javascript

    - by biju
    Hi, I tried to write a function on a js file and another function with the same name in the page.I expected an error but no error came and i got only the function from the js file to execute.How is this possible.Even if i write a function in a separate js file,everything is rendered in a single html file.Then how come it is possible <script type="text/javascript" language="javascript" src="JScript.js" /> <script language="javascript"> function Boo() { alert("Hai new"); } </script> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Button runat=server OnClientClick="Boo();" Text="Click" /> </div> </form> </body> and in the js file function Boo() { alert("Hai"); }

    Read the article

  • UTF-8 MySQL and Charset, pls help me understand this once and for all!

    - by FFish
    Can someone explain me when I set everything to UTF-8 I keep getting those damn ??? MySQL Server version: 5.1.44 MySQL charset: UTF-8 Unicode (utf8) I create a new database name: utf8test collation: utf8_general_ci MySQL connection collation: utf8_general_ci My SQL looks like this: SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; CREATE TABLE IF NOT EXISTS `test_table` ( `test_id` int(11) NOT NULL, `test_text` text NOT NULL, PRIMARY KEY (`test_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; INSERT INTO `test_table` (`test_id`, `test_text`) VALUES (1, 'hééélo'), (2, 'wööörld'); My PHP / HTML: <?php $db_conn = mysql_connect("localhost", "root", "") or die("Can't connect to db"); mysql_select_db("utf8test", $db_conn) or die("Can't select db"); // $result = mysql_query("set names 'utf8'"); // this works... why?? $query = "SELECT * FROM test_table"; $result = mysql_query($query); $output = ""; while($row = mysql_fetch_assoc($result)) { $output .= "id: " . $row['test_id'] . " - text: " . $row['test_text'] . "<br />"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="it" xmlns="http://www.w3.org/1999/xhtml" xml:lang="it"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>UTF-8 test</title> </head> <body> <?php echo $output; ?> </body> </html>

    Read the article

  • Read IFrame content using JavaScript

    - by Rajat
    Ok, This is my first time dealing seriously with IFrames and I cant seem to understand a few things: First the sample code I am testing with: <head> <script type="text/javascript"> function init(){ console.log("IFrame content: " + window.frames['i1'].document.getElementsByTagName('body')[0].innerHTML); } </script> </head> <body onload="init();"> <iframe name="i1" src="foo.txt"/> </body> the file "foo.txt" looks like this: sample text file Questions: 1) The iframe seems to be behaving as a HTML document and the file text is actually part of the body instead. Why ? Is it a rule for an IFrame to be a HTML document. Is it not possible for the content of an iframe to be just plain text ?? 2) The file content gets wrapped inside a pre tag for some reason. Why is this so ? Is it always the case? 3) My access method in the javascript is working but is there any other alternative? [native js solutions please] If the content is wrapped in a pre tag always then I will actually have to lookup inside the pre tag rather than lookup the innerHTML

    Read the article

  • Event type property lost in IE-8

    - by Channel72
    I've noticed a strange Javascript error which only seems to happen on Internet Explorer 8. Basically, on IE-8 if you have an event handler function which captures the event object in a closure, the event "type" property seems to become invalidated from within the closure. Here's a simple code snippet which reproduces the error: <html> <head> <script type = "text/javascript"> function handleClickEvent(ev) { ev = (ev || window.event); alert(ev.type); window.setTimeout(function() { alert(ev.type); // Causes error on IE-8 }, 20); } function foo() { var query = document.getElementById("query"); query.onclick = handleClickEvent; } </script> </head> <body> <input id = "query" type = "submit"> <script type = "text/javascript"> foo(); </script> </body> </html> So basically, what happens here is that within the handleClickEvent function, we have the event object ev. We call alert(ev.type) and we see the event type is "click". So far, so good. But then when we capture the event object in a closure, and then call alert(ev.type) again from within the closure, now all of a sudden Internet Explorer 8 errors, saying "Member not found" because of the expression ev.type. It seems as though the type property of the event object is mysteriously gone after we capture the event object in a closure. I tested this code snippet on Firefox, Safari and Chrome, and none of them report an error condition. But in IE-8, the event object seems to become somehow invalidated after it's captured in the closure. Question: Why is this happening in IE-8, and is there any workaround?

    Read the article

  • How to get rid of white space between css horizontal list items?

    - by Curyous
    I've got the following test page and css. When displayed, there is a 4px gap between each list item. How do I get the items to be next to each other? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> <html> <head> <link type="text/css" rel="stylesheet" href="/stylesheets/test.css" /> </head> <body> <div> <ul class="nav"> <li class="nav"><a class="nav" href="#">One1</a></li> <li class="nav"><a class="nav" href="#">Two</a></li> <li class="nav"><a class="nav" href="#">Three</a></li> <li class="nav"><a class="nav" href="#">Four</a></li> </ul> </div> </body> </html> The css: ul.nav, ul li.nav { display: inline; margin: 0px; padding: 0px; } ul.nav { list-style-type: none; } li.nav { background-color: red; } a.nav { background-color: green; padding: 10px; margin: 0px; } a:hover.nav { background-color: gray; }

    Read the article

  • trouble finding element on page using xpath or css

    - by doneright
    Guys, I'm trying to write xpath or css to find/click on list element "All" based on known span(in this case SNG NAME below). On page, there are different lists Which can contain same list item called as "All". So we have to identify "All" based on span(in this case SNG NAME below) can someone shed some light on my issue <html> <head> <body> <div class="grc_selected"> <div class ="lbl_selected"> <span> SNG NAME </span> </div> <div id="id1" class="cl1"> <ul id="id_ul"> <li class="tclass" title="[1] All"> <img class="treeIcon" src="1/2/3.gif"/> <span class="inA">All</span> </li> </ul> </div> </body> </head> </html>

    Read the article

  • javascript: "Object doesn't support this property or method" when ActiveX object called.

    - by agnieszka
    I've got simple html on Login.aspx with an ActiveX object: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head><title></title> <script language="javaScript" type="text/javascript"> function getUserInfo() { var userInfo = MyActiveX.GetInfo(); form1.info.value = userInfo; form1.submit(); } </script> </head> <body onload="javascript:getUserInfo()"> <object id="MyActiveX" name="MyActiveX" codebase="MyActiveX.cab" classid="CLSID:C63E6630-047E-4C31-H457-425C8412JAI25"></object> <form name="form1" method="post" action="Login.aspx"> <input type="hidden" id="info" name="info" value="" /> </form> </body> </html> The code works perfectly fine on my machine (edit: hosted and run), it does't work on the other: there is an error "Object doesn't support this property or method" in the first line of javascript function. The cab file is in the same folder as the page file. I don't know javascript at all and have no idea why is the problem occuring. Googling didn't help. Do you ave any idea? Edit: on both machines IE was used and activex was enabled. Edit2: I also added if (document.MyActiveX) at the beggining of the function and I still get error in the same line of code - I mean it looks like document.MyActiveX is true but calling the method still fails

    Read the article

  • How can I read the value of a radio button in JavaScript?

    - by Corey
    <html> <head> <title>Tip Calculator</title> <script type="text/javascript"><!-- function calculateBill(){ var check = document.getElementById("check").value; /* I try to get the value selected */ var tipPercent = document.getElementById("tipPercent").value; /* But it always returns the value 15 */ var tip = check * (tipPercent / 100) var bill = 1 * check + tip; document.getElementById('bill').innerHTML = bill; } --></script> </head> <body> <h1 style="text-align:center">Tip Calculator</h1> <form id="f1" name="f1"> Average Service: 15% <input type="radio" id="tipPercent" name="tipPercent" value="15" /> <br /> Excellent Service: 20% <input type="radio" id="tipPercent" name="tipPercent" value="20" /> <br /><br /> <label>Check Amount</label> <input type="text" id="check" size="10" /> <input type="button" onclick="calculateBill()" value="Calculate" /> </form> <br /> Total Bill: <p id="bill"></p> </body> </html> I try to get the value selected with document.getElementById("tipPercent").value, but it always returns the value 15.

    Read the article

  • How add class='active' to html menu with php

    - by meow
    Hello I want to put my html navigation in a separate php file so when I need to edit it, I only have to edit it once. The problem starts when I want to add the class active to the active page. I've got three pages and one common file. common.php : <?php $nav = <<<EOD <div id="nav"> <ul> <li><a <? if($page == 'one'): ?> class="active"<? endif ?> href="index.php">Tab1</a>/</li> <li><a href="two.php">Tab2</a></li> <li><a href="three.php">Tab3</a></li> </ul> </div> EOD; ?> index.php : All three pages are identical except their $page is different on each page. <?php $page = 'one'; require_once('common.php'); ?> <html> <head></head> <body> <?php echo $nav; ?> </body> </html> This simply won't work unless I put my nav on each page, but then the whole purpose of separating the nav from all pages is ruined. Is what I want to accomplish even possible? What am I doing wrong? Thanks EDIT: When doing this, the php code inside the li don't seem to run, it's just being printed as if it was html

    Read the article

  • Intro Bar like stack overflow

    - by Dasa
    I have a simple top bar using jquery like the one on stackoverflow, but i want it to only appear on the first time a person visits the website. below is the HTML followed by the "bxSlider.js" file <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript" src="bxSlider.js"></script> <title>topbar</title> <style type="text/css" media="screen"> #message { font-family:Arial,Helvetica,sans-serif; position:fixed; top:0px; left:0px; width:100%; z-index:105; text-align:center; color:white; padding:2px 0px 2px 0px; background-color:#8E1609; } #example1 { text-align: center; width: 80%; } .close-notify { white-space: nowrap; float:right; margin-right:10px; color:#fff; text-decoration:none; padding-left:3px; padding-right:3px } .close-notify a { color: #fff; } h4, p { margin:0px; padding:0px; } </style> </head> <body> <DIV ID='message' style="display: none;"> <DIV ID="example1"> <DIV CLASS="item"> <h4>Head 1</h4> <p>Text 1</p> </div><!-- end item --> <DIV CLASS="item"> <h4>Head 2</h4> <p>Text 2</p> </div><!-- end item --> </div><!-- end example1 --> <a href="#" CLASS="close-notify" onclick="closeNotice()">X</a> </div> <script type="text/javascript"> $(document).ready(function() { $("#message").fadeIn("slow"); $('#example1').bxSlider({ mode: 'slide', speed: 250, wrapper_CLASS: 'example1_container' }); }); function closeNotice() { $("#message").fadeOut("slow"); } </script> </body> </html> /** * * * bxSlider: Content slider / fade / ticker using the jQuery javascript library. * * Author: Steven Wanderski * Email: [email protected] * URL: http://bxslider.com * * **/ jQuery.fn.bxSlider = function(options){ ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Declare variables and functions ///////////////////////////////////////////////////////////////////////////////////////////////////////////// var defaults = { mode: 'slide', speed: 500, auto: false, auto_direction: 'left', pause: 2500, controls: true, prev_text: 'prev', next_text: 'next', width: $(this).children().width(), prev_img: '', next_img: '', ticker_direction: 'left', wrapper_class: 'container' }; options = $.extend(defaults, options); if(options.mode == 'ticker'){ options.auto = true; } var $this = $(this); var $parent_width = options.width; var current = 0; var is_working = false; var child_count = $this.children().size(); var i = 0; var j = 0; var k = 0; function animate_next(){ is_working = true; $this.animate({'left':'-' + $parent_width * 2 + 'px'}, options.speed, function(){ $this.css({'left':'-' + $parent_width + 'px'}).children(':first').appendTo($this); is_working = false; }); } function animate_prev(){ is_working = true; $this.animate({'left': 0}, options.speed, function(){ $this.css({'left':'-' + $parent_width + 'px'}).children(':last').insertBefore($this.children(':first')); is_working = false; }); } function fade(direction){ if(direction == 'next'){ var last_before_switch = child_count - 1; var start_over = 0; var incr = k + 1; }else if(direction == 'prev'){ var last_before_switch = 0; var start_over = child_count -1; var incr = k - 1; } is_working = true; if(k == last_before_switch){ $this.children().eq(k).fadeTo(options.speed, 0); $this.children().eq(start_over).fadeTo(options.speed, 1, function(){ is_working = false; k = start_over; }); }else{ $this.children().eq(k).fadeTo(options.speed, 0); $this.children().eq(incr).fadeTo(options.speed, 1, function(){ is_working = false; k = incr; }); } } function add_controls(){ ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Check if user selected images to use for next / prev ///////////////////////////////////////////////////////////////////////////////////////////////////////////// if(options.prev_img != '' || options.next_img != ''){ $this.parent().append('<a class="slider_prev" href=""><img src="' + options.prev_img + '" alt=""/></a><a class="slider_next" href=""><img src="' + options.next_img + '" alt="" /></a>'); }else{ $this.parent().append('<a class="slider_prev" href="">' + options.prev_text + '</a><a class="slider_next" href="">' + options.next_text + '</a>'); } $this.parent().find('.slider_prev').css({'float':'left', 'outline':'0', 'color':'yellow'}); $this.parent().find('.slider_next').css({'float':'right', 'outline':'0', 'color':'yellow'}); ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Accomodate padding-top for controls when elements are absolutely positioned (only in fade mode) ///////////////////////////////////////////////////////////////////////////////////////////////////////////// if(options.mode == 'fade'){ $this.parent().find('.slider_prev').css({'paddingTop' : $this.children().height()}) $this.parent().find('.slider_next').css({'paddingTop' : $this.children().height()}) } ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Actions when user clicks next / prev buttons ///////////////////////////////////////////////////////////////////////////////////////////////////////////// $this.parent().find('.slider_next').click(function(){ if(!is_working){ if(options.mode == 'slide'){ animate_next(); if(options.auto){ clearInterval($.t); $.t = setInterval(function(){animate_next();}, options.pause); } }else if(options.mode == 'fade'){ fade('next'); if(options.auto){ clearInterval($.t); $.t = setInterval(function(){fade('next');}, options.pause); } } } return false; }); $this.parent().find('.slider_prev').click(function(){ if(!is_working){ if(options.mode == 'slide'){ animate_prev(); if(options.auto){ clearInterval($.t); $.t = setInterval(function(){animate_prev();}, options.pause); } }else if(options.mode == 'fade'){ fade('prev'); if(options.auto){ clearInterval($.t); $.t = setInterval(function(){fade('prev');}, options.pause); } } } return false; }); } function ticker() { if(options.ticker_direction == 'left'){ $this.animate({'left':'-' + $parent_width * 2 + 'px'}, options.speed, 'linear', function(){ $this.css({'left':'-' + $parent_width + 'px'}).children(':first').appendTo($this); ticker(); }); }else if(options.ticker_direction == 'right'){ $this.animate({'left': 0}, options.speed, 'linear', function(){ $this.css({'left':'-' + $parent_width + 'px'}).children(':last').insertBefore($this.children(':first')); ticker(); }); } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Create content wrapper and set CSS ///////////////////////////////////////////////////////////////////////////////////////////////////////////// $this.wrap('<div class="' + options.wrapper_class + '"></div>'); //console.log($this.parent().css('paddingTop')); if(options.mode == 'slide' || options.mode == 'ticker'){ $this.parent().css({ 'overflow' : 'hidden', 'position' : 'relative', 'margin' : '0 auto', 'width' : options.width + 'px' }); $this.css({ 'width' : '999999px', 'position' : 'relative', 'left' : '-' + $parent_width + 'px' }); $this.children().css({ 'float' : 'left', 'width' : $parent_width }); $this.children(':last').insertBefore($this.children(':first')); }else if(options.mode == 'fade'){ $this.parent().css({ 'overflow' : 'hidden', 'position' : 'relative', 'width' : options.width + 'px' //'height' : $this.children().height() }); if(!options.controls){ $this.parent().css({'height' : $this.children().height()}); } $this.children().css({ 'position' : 'absolute', 'width' : $parent_width, 'listStyle' : 'none', 'opacity' : 0 }); $this.children(':first').css({ 'opacity' : 1 }); } ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Check if user selected "auto" ///////////////////////////////////////////////////////////////////////////////////////////////////////////// if(!options.auto){ add_controls(); }else{ if(options.mode == 'ticker'){ ticker(); }else{ ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Set a timed interval ///////////////////////////////////////////////////////////////////////////////////////////////////////////// if(options.mode == 'slide'){ if(options.auto_direction == 'left'){ $.t = setInterval(function(){animate_next();}, options.pause); }else if(options.auto_direction == 'right'){ $.t = setInterval(function(){animate_prev();}, options.pause); } }else if(options.mode == 'fade'){ if(options.auto_direction == 'left'){ $.t = setInterval(function(){fade('next');}, options.pause); }else if(options.auto_direction == 'right'){ $.t = setInterval(function(){fade('prev');}, options.pause); } } if(options.controls){ add_controls(); } } } }

    Read the article

  • how do I call a javacript function every 60 seconds?

    - by William
    So I'm trying to work on a Canvas demo, and I want this square to move from one side to the other, but I can't figure out how to call javascript in a way that repeats every 60 seconds. Here's what I got so far: <!DOCTYPE html> <html lang="en"> <head> <title>Canvas test</title> <meta charset="utf-8" /> <link href="/bms/style.css" rel="stylesheet" /> <style> body { text-align: center; background-color: #000000;} canvas{ background-color: #ffffff;} </style> <script type="text/javascript"> var x = 50; var y = 250; function update(){ draw(); x = x + 5; } function draw(){ var canvas = document.getElementById('screen1'); if (canvas.getContext){ var ctx = canvas.getContext('2d'); ctx.fillStyle = 'rgb(236,138,68)'; ctx.fillRect(x,y,24,24); } } </script> </head> <body onLoad="setTimeout(update(), 0);"> <canvas id="screen1" width="500" height="500"></canvas> </body> </html>

    Read the article

  • doubt in javascript name validation

    - by raja
    Hi: I am using the below validation for textbox which accepts only alphabets and maximum of 50 characters. I am passing the object directly in the parameter. The below case by giving the field name i.e "my_text" directly is working is working fine. But if i pass it in variable, that time it is not working(commented the if statement). Please help me. My requirement is each time when we enter the charater, the hardcode field name should not be used in the validation. <html><head> <script language=JavaScript> function check_length(my_form,fieldName) { alert(fieldName); // if (my_form.fieldName.value.length >= maxLen) { if (my_form.my_text.value.length >= maxLen) { var msg = "You have reached your maximum limit of characters allowed"; alert(msg); my_form.my_text.value = my_form.my_text.value.substring(0, maxLen); } else{ var keyCode = window.event.keyCode; if ((keyCode < 65 || keyCode > 90) && (keyCode < 97 || keyCode > 123) && keyCode != 32) { window.event.returnValue = false; alert("Enter only Alphabets"); } my_form.text_num.value = maxLen - my_form.my_text.value.length;} } </script> </head> <body> <form name=my_form method=post> <input type="text" onKeyPress=check_length(this.form,this.name); name=my_text rows=4 cols=30> <br> <input size=1 value=50 name=text_num> Characters Left </form> </body> </html>

    Read the article

  • javascript mouse cursor change on page load in firefox browser 3.5

    - by Amit
    Hi in case of full page submit a trasparent div id coming and changing the cursor to 'wait' . Now when the page is getting submitted and new page is coming up cursor still remains to 'wait' not changing to default until mouse is moved in Firefox Here is simple html click on show button div is coming when user move mouse over the div cursor is changing as wait cursor. Now when this page is loaded again pressing F5 cursor remain as wait cursor in firefox its working fine in IE is there any way to make the cursor as default on pageload in Firefox <!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=iso-8859-1" /> <title>Untitled Document</title> <style> body{ cursor:default; } </style> <script src="js/jquery.js"> </script> <script> var test = true; $(document).ready(function(){ $('#maindiv').css('display','none') }); function showDiv(){ $('#maindiv').css('display','block') } </script> </head> <body> <div id="divBody" style="background-color:red;width:500px;height:500px" >aa <div id="maindiv" style="background-color:#999999;height:100$;width:400px;height:400px;cursor:wait"> sss </div>aa </div> <input type="button" value="show" onclick="showDiv()"/> </body> </html>

    Read the article

  • Sticky/static variable references in for loops

    - by pthulin
    In this example I create three buttons 'one' 'two' 'three'. When clicked I want them to alert their number: <html> <head> <script type="application/javascript" src="jquery.js"></script> <script type="application/javascript"> $(document).ready(function() { var numbers = ['one', 'two', 'three']; for (i in numbers) { var nr = numbers[i]; var li = $('<li>' + nr + '</li>'); li.click(function() { var newVariable = String(nr); alert(i); // 2 alert(nr); // three alert(newVariable); // three alert(li.html()); // three }); $('ul').append(li); } }); </script> </head> <body> <ul> </ul> </body> </html> The problem is, when any of these are clicked, the last value of the loop's variables is used, i.e. alert box always says 'three'. In JavaScript, variables inside for-loops seem to be 'static' in the C language sense. Is there some way to create separate variables for each click function, i.e. not using the same reference? Thanks!

    Read the article

  • IE7 modal dialog scrollbars overlap content

    - by cdmckay
    Here's the offending code. To test it, save it in a file called "test.html" and click the button in the top-left corner. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Blarg</title> <style type='text/css'> body { margin: 20px; } #test { background: red; height: 2000px; } </style> </head> <body> <div id="test"><input type='button' onclick="javascript:window.showModalDialog('test.html', window, 'dialogWidth: 300px; resizable: yes;');" /></div> </body> </html> If I open the page in normal IE7 window, it works fine. However, if I open it in an IE7 modal dialog, it draws the vertical scrollbar on top of the margin. What's even worse, because it draws the scrollbar on top of the margin, it also causes a horizontal scrollbar to be drawn. How do I work around this? I absolutely must use the IE modal dialog, I'm not at liberty to change that.

    Read the article

  • Calling jQuery method from onClick attribute in HTML

    - by Russell
    I am relatively new to implementing JQuery throughout an entire system, and I am enjoying the opportunity. I have come across one issue I would love to find the correct resolve for. Here is a simple case example of what I want to do: I have a button on a page, and on the click event I want to call a jquery function I have defined. Here is the code I have used to define my method (Page.js): (function($) { $.fn.MessageBox = function(msg) { alert(msg); }; }); And here is my HTML page: <HTML> <head> <script type="text/javascript" src="C:\Sandpit\jQueryTest\jquery-1.3.2.js"></script> <script language="javascript" src="Page.js"></script> </head> <body> <div class="Title">Welcome!</div> <input type="button" value="ahaha" onclick="$().MessageBox('msg');" /> </body> </HTML> (The above code displays the button, but clicking does nothing.) I am aware I could add the click event in the document ready event, however it seems more maintainable to put events in the HTML element instead. However I have not found a way to do this. Is there a way to call a jquery function on a button element (or any input element)? Or is there a better way to do this? Thanks

    Read the article

  • RetinaJS and LESS : Background image doesn't show on iOS

    - by jidma
    I am trying to make a background image into a retina image using LESS CSS and RetinaJs: in my index.html file : <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> [...] <link type="text/css" rel="stylesheet/less" href="resources/css/retina.less"> <script type="text/javascript" src="resources/js/less-1.3.0.minjs" ></script> [...] </head> <body> [...] <script type="text/javascript" src="resources/js/retina.js"></script> </body> </html> in my retina.less file: .at2x(@path, @w: auto, @h: auto) { background-image: url("@{path}"); @at2x_path: ~`"@{path}".split('.').slice(0, "@{path}".split('.').length - 1).join(".") + "@2x" + "." + "@{path}".split('.')["@{path}".split('.').length - 1]`; @media all and (-webkit-min-device-pixel-ratio : 1.5) { background-image: url("@{at2x_path}"); background-size: @w @h; } } .topMenu { .at2x('../../resources/img/topMenuTitle.png'); } I have both topMenuTitle.png (320px x 40px) and [email protected] (640px x 80px) in the same folder. When test this code: In Firefox i have the normal Background In the XCode iPhone simulator I also have the normal Background In the iPhone device, I don't have any background at all. I'm using GWT if that matters. Any suggestions ? Thanks.

    Read the article

  • Facebook not recoginising open graph tags

    - by Pratik Poddar
    My object page looks like: <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xmlns:fb="https://www.facebook.com/2008/fbml"> <head prefix="og: http://ogp.me/ns# cliprin: http://ogp.me/ns/apps/cliprin#"> <meta property="fb:app_id" content="143944345745133" /> <meta property="og:type" content="cliprin:product" /> <meta property="og:url" content="https://itsourstudio.com/" /> <meta property="og:title" content="LED Ice Cubes (Set Of 4)" /> <meta property="og:sitename" content="Its Our Studio" /> <meta property="og:image" content="https://s-static.ak.fbcdn.net/images/devsite/attachment_blank.png" /> <meta property="og:description" content="Blah Blah Blah" /> </head> </html> The JSLink Debugger of the page as shown by the link shows that of:type is website and gives following warnings: Open Graph Warnings That Should Be Fixed Inferred Property: The 'og:url' property should be explicitly provided, even if a value can be inferred from other tags. Inferred Property: The 'og:title' property should be explicitly provided, even if a value can be inferred from other tags. Inferred Property: The 'og:description' property should be explicitly provided, even if a value can be inferred from other tags. Inferred Property: The 'og:image' property should be explicitly provided, even if a value can be inferred from other tags. Tiny og:image: All the images referenced by og:image must be at least 200px in both dimensions. Please check all the images with tag og:image in the given url and ensure that it meets the minimum specification.

    Read the article

  • Why doesn't Javascript recognize the HTML class attribute?

    - by Cornflake
    Can anyone help me with a Javascript question, please? Why does the following code display only message boxes with the word "null" in them? And I think there are not enough of them either. <html> <head> <script type="text/javascript"> function showElementClasses(node) { var els = node.getElementsByTagName("*"); for(var i=0,j=els.length; i<j; i++) alert(els[i].getAttribute("class")); alert("Class: " + els[i].className); } showElementClasses(document); </script> </head> <body class="bla"> <div class="myclass" style="width: 500; height: 400" id="map"></div> </body> </html>

    Read the article

  • Any solution to IE8 bug rendering error when hiding elements?

    - by Magnar
    Bug: when hiding an element with JavaScript in IE8, the margin of still-visible other elements on the side is ignored. This bug has been introduced with IE8, since it works as expected in IE6+7 (and other browsers). <html> <head> <style> #a, #b, #c, #d {background: #ccf; padding: 4px; margin-bottom: 8px;} </style> </head> <body> <div id="a">a</div> <div id="b">b</div> <div id="c">c</div> <div id="d">d</div> <script> setTimeout(function () { document.getElementById("b").style.display = "none"; }, 1000); </script> </body> </html> When running this code, notice how a and c have a margin of 8 between them in normal browsers, but a margin of 0 in IE8. Remove the padding, and IE8 behaves like normal. Remove the timeout and IE8 behaves like normal. A border behaves the same way. I've been working with IE-bugs the last 10 years, but this has me stumped. The solution for now is to wrap the divs, and apply the margin to the outer element and other styles to the inner. But that's reminicent of horrible IE6-workarounds. Any better solutions?

    Read the article

< Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >