Search Results

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

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

  • 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

  • XPath _relative_ to given element in HTMLUnit/Groovy?

    - by Misha Koshelev
    Dear All: I would like to evaluate an XPath expression relative to a given element. I have been reading here: http://www.w3schools.com/xpath/default.asp And it seems like one of the syntaxes below should work (esp no leading slash or descendant:) However, none seem to work in HTMLUnit. Any help much appreciated (oh this is a groovy script btw). Thank you! http://htmlunit.sourceforge.net/ http://groovy.codehaus.org/ Misha #!/usr/bin/env groovy import com.gargoylesoftware.htmlunit.WebClient def html=""" <html><head><title>Test</title></head> <body> <div class='levelone'> <div class='leveltwo'> <div class='levelthree' /> </div> <div class='leveltwo'> <div class='levelthree' /> <div class='levelthree' /> </div> </div> </body> </html> """ def f=new File('/tmp/test.html') if (f.exists()) { f.delete() } def fos=new FileOutputStream(f) fos<<html def webClient=new WebClient() def page=webClient.getPage('file:///tmp/test.html') def element=page.getByXPath("//div[@class='levelone']") assert element.size()==1 element=page.getByXPath("div[@class='levelone']") assert element.size()==0 element=page.getByXPath("/div[@class='levelone']") assert element.size()==0 element=page.getByXPath("descendant:div[@class='levelone']") // this gives namespace error assert element.size()==0 Thank you!!!

    Read the article

  • How to add on key down and on key up event in java script

    - by Ramesh
    Hello , I am creating an live search for my blog..i got this from w3 schools and i need to add on keyboard up,down mouse up and down event ... <html> <head> <script type="text/javascript"> function showResult(str) { if (str.length==0) { document.getElementById("livesearch").innerHTML=""; document.getElementById("livesearch").style.border="0px"; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("livesearch").innerHTML=xmlhttp.responseText; document.getElementById("livesearch").style.border="1px solid #A5ACB2"; } } xmlhttp.open("GET","livesearch.php?q="+str,true); xmlhttp.send(); } </script> </head> <body> <form> <input type="text" size="30" onkeyup="showResult(this.value)" /> <div id="livesearch"></div> </form> </body> </html>

    Read the article

  • Letter spacing issue with 'overlapping' character

    - by Wesz-T
    I'm having some trouble with a font I found on Google Web Fonts. As you can see in the image posted below, the capital V in 'Versus' overlaps with the 'e' when i'm using Firefox. Though when i'm using Chrome (or IE) it does not overlap and leaves me with an ugly space between the two characters. Is there any way to fix this and make it look like the one in Firefox? Or should I start looking for another font? My HTML: <html> <head> <meta charset="utf-8"> <title>Versus</title> <link rel="stylesheet" type="text/css" href="css/reset.css" /> <link rel="stylesheet" type="text/css" href="css/style.css" /> <link href='http://fonts.googleapis.com/css?family=Marck+Script' rel='stylesheet' type='text/css'> </head> <body> <div> <h1>Versus</h1> </div> </body> My CSS: h1 { font-family: 'Marck Script', cursive; font-size: 100px; color:#444; text-align:center; padding:0 50px; text-shadow: 2px 2px 3px #777; } Thanks in advance!

    Read the article

  • php and mysql listing databases and looping through results

    - by Jacksta
    Beginner help needed :) I am doign an example form a php book which lists tables in databases. I am getting an error on line 36: $db_list .= "$table_list"; <?php //connect to database $connection = mysql_connect("localhost", "admin_cantsayno", "cantsayno") or die(mysql_error()); //list databases $dbs = @mysql_list_dbs($connection) or die(mysql_error()); //start first bullet list $db_list = "<ul>"; $db_num = 0; //loop through results of functions while ($db_num < mysql_num_rows($dbs)) { //get database names and make each a list point $db_names[$db_num] = mysql_tablename($dbs, $db_num); $db_list .= "<li>$db_names[$db_num]"; //get table names and make another list $tables = @mysql_list_tables($db_names[$db_num]) or die(mysql_error()); $table_list = "<ul>"; $table_num = 0; //loop through results of function while ($table_num < mysql_num_rows($tables)){ //get table names and make each bullet point $table_names[$table_num] = mysql_tablename($tables, $table_num); $table_list .= "<li>$table_names[$table_num]"; $table_num++; } //close inner bullet list and increment number to continue $table_list .= "</ul>" $db_list .= "$table_list"; $db_num++; } //close outer bullet list $db_list .= "</ul>"; ?> <html> <head> <title>MySQL Tables</title> </head> <body> <p><strong>Data bases and tables on local host</strong></p> <? echo "$db_list"; ?> </body>

    Read the article

  • jQuery('body').text() gives different answers in different browsers

    - by Charles Anderson
    My HTML looks like this: <html> <head> <title>Test</title> <script type="text/javascript" src="jQuery.js"></script> <script type="text/javascript"> function init() { var text = jQuery('body').text(); alert('length = ' + text.length); } </script> </head> <body onload="init()">0123456789</body> </html> When I load this in Firefox, the length is reported as 10. However, in Chrome it's 11 because it thinks there's a linefeed after the '9'. In IE it's also 11, but the last character is an escape. Meanwhile, Opera thinks there are 12 characters, with the last two being CR LF. If I change the body element to include a span: <body onload="init()"><span>0123456789</span></body> and the jQuery call to: var text = jQuery('body span').text(); then all the browsers agree that the length is 10. Clearly it's the body element that's causing the issue, but can anyone explain exactly why this is happening? I'm particularly surprised because the excellent jQuery is normally browser-independent.

    Read the article

  • Execute javascript in PHP

    - by Andreas Bonini
    I'm generating your typical Web 2.0 HTML page with PHP: it contains a lot of <script> tags and javascript code that will substantially change the DOM after the load event. Is there a way to get the final HTML code directly from PHP, without opening the page with any browser? For example, let's say the HTML for the page is (it's just an example): <html> <head> <script>...the jquery library code...</script> <script>$(document).ready(function() { $("body").append("<p>Hi!</p>");</script> </head> <body> </body> </html> This HTML is saved in the $html PHP variable. Now, I want to pass that variable to some function that will return $result = <html>....<body><p>Hi!</p></body></html>. Is this possible?

    Read the article

  • Expand chaining hashtable. Errors on code.

    - by FILIaS
    Expanding a hashtable with linked lists there are some errors and warnings. I wanna make sure that the following code is right (expand method) and find out what happens that raise these warnings/errors typedef struct { int length; struct List *head; struct List *tail; } HashTable; //resolving collisions using linked lists - chaining typedef struct { char *number; char *name; int time; struct List *next; }List; //on the insert method i wanna check hashtable's size, //if it seems appropriate there is the following code: //Note: hashtable variable is: Hashtable * ...... hashtable = expand(hashtable,number,name,time); /**WARNING**:assignment makes pointer from integer without a cast*/ HashTable* expand( HashTable* h ,char number[10],char* name,int time) /**error**: conflicting types for ‘expand’ previous implicit declaration of ‘expand’ was here*/ { HashTable* new; int n; clientsList *node,*next; PrimesIndex++; int new_size= primes[PrimesIndex]; /* double the size,odd length */ if (!(new=malloc((sizeof( List*))*new_size))) return NULL; for(n=0; n< h->length; ++n) { for(node=h[n].head; node; node=next) { add (&new, node->number, node->name,node->time); next=node->next;//// free(node); } } free(h); return new; }

    Read the article

  • "Access is denied" by executing .hta file with JScript on Windows XP x64

    - by mem64k
    I have a simple HTML (as HTA) application that shows strange behavior on Windows XP x64 machine. I getting periodically (not every time) error message "Access is denied." when i start the application. The same application on Windows XP 32bit runs just fine... Does somebody has any idea or explanation? Error message: Line: 18 Char: 6 Error: Access is denied. Code: 0 URL: file:///D:/test_j.hta Here is the code of my "test_j.hta": <html> <head> <title>Test J</title> <HTA:APPLICATION ID="objTestJ" APPLICATIONNAME="TestJ" SCROLL="no" SINGLEINSTANCE="yes" WINDOWSTATE="normal" > <script language="JScript"> function main() { //window.alert("test"); window.resizeTo(500, 300); } function OnExit() { window.close(); } </script> </head> <body onload="main()"> <input type="button" value="Exit" name="Exit" onClick="OnExit()" title="Exit"> </body> </html>

    Read the article

  • Parsing XHTML with inline tags

    - by user290796
    Hi, I'm trying to parse an XHTML document using TBXML on the iPhone (although I would be happy to use either libxml2 or NSXMLParser if it would be easier). I need to extract the content of the body as a series of paragraphs and maintain the inline tags, for example: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>Title</title> <link rel="stylesheet" href="css/style.css" type="text/css"/> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/> </head> <body> <div class="body"> <div> <h3>Title</h3> <p>Paragraph with <em>inline</em> tags</p> <img src="image.png" /> </div> </div> </body> </html> I need to extract the paragraph but maintain the <em>inline</em> content with the paragraph, all my testing so far has extracted that as a subelement without me knowing exactly where it fitted in the paragraph. Can anyone suggest a way to do this? Thanks.

    Read the article

  • once again..."$ is not defined" - trying to implement sIFR

    - by supervision
    Hey Guys, my file beginning looks like this: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>My title</title> <link rel="stylesheet" type="text/css" href="css/style.css" /> <script src="js/update.js" type="text/javascript"></script> <!-- sifr --> <link href="sifr207/sIFR-screen.css" rel="stylesheet" type="text/css" media="screen" /> <script src="sifr207/sifr.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { if(typeof sIFR == "function") { sIFR.replaceElement("sifr", named({sFlashSrc: "sIFR-2.0.7/corporateacon-reg.swf", sColor: "#FF0000" , sWmode: "transparent"})); }; }); </script> <!-- --> </head> I really do not understand why the '$(document).ready(function()' is not found, because I implement sifr.js BEFORE that call. Any suggestions? I would appriciate it, really! shoutz, supervision

    Read the article

  • Convert a Dynamic[] construct to a numerical list

    - by Leo Alekseyev
    I have been trying to put together something that allows me to extract points from a ListPlot in order to use them in further computations. My current approach is to select points with a Locator[]. This works fine for displaying points, but I cannot figure out how to extract numerical values from a construct with head Dynamic[]. Below is a self-contained example. By dragging the gray locator, you should be able to select points (indicated by the pink locator and stored in q, a list of two elements). This is the second line below the plot. Now I would like to pass q[[2]] to a function, or perhaps simply display it. However, Mathematica treats q as a single entity with head Dynamic, and thus taking the second part is impossible (hence the error message). Can anyone shed light on how to convert q into a regular list? EuclideanDistanceMod[p1_List, p2_List, fac_: {1, 1}] /; Length[p1] == Length[p2] := Plus @@ (fac.MapThread[Abs[#1 - #2]^2 &, {p1, p2}]) // Sqrt; test1 = {{1.`, 6.340196001221532`}, {1.`, 13.78779876355869`}, {1.045`, 6.2634018978377295`}, {1.045`, 13.754947081416544`}, {1.09`, 6.178367702583522`}, {1.09`, 13.72055251752498`}, {1.135`, 1.8183153704413153`}, {1.135`, 6.082497198000075`}, {1.135`, 13.684582525399742`}, {1.18`, 1.6809452373465104`}, {1.18`, 5.971583107298081`}, {1.18`, 13.646996905469383`}, {1.225`, 1.9480537697339537`}, {1.225`, 5.838386922625636`}, {1.225`, 13.607746407088161`}, {1.27`, 2.1183174369679234`}, {1.27`, 5.669799095595362`}, {1.27`, 13.566771130126131`}, {1.315`, 2.2572975468163463`}, {1.315`, 5.444014254828522`}, {1.315`, 13.523998701347882`}, {1.36`, 2.380307009155079`}, {1.36`, 5.153024664297602`}, {1.36`, 13.479342200528283`}, {1.405`, 2.4941312539733285`}, {1.405`, 4.861423833512566`}, {1.405`, 13.432697814928654`}, {1.45`, 2.6028066447609426`}, {1.45`, 4.619367407525507`}, {1.45`, 13.383942212133244`}}; DynamicModule[{p = {1.2, 10}, q = {1.3, 11}}, q := Dynamic@ First@test1[[ Ordering[{#, EuclideanDistanceMod[p, #, {1, .1}]} & /@ test1, 1, #1[[2]] < #2[[2]] &]]]; Grid[{{Show[{ListPlot[test1, Frame -> True, ImageSize -> 300], Graphics@Locator[Dynamic[p]], Graphics@ Locator[q, Appearance -> {Small}, Background -> Pink]}]}, {Dynamic@p}, {q},{q[[2]]}}]]

    Read the article

  • Linked List push()

    - by JKid314159
    The stack is initialized with a int MaxSize =3. Then I push one int onto the list. " Pushed:" is returned to the console. Program crashes here. I think my logic is flawed but unsure. Maybe an infinite loop or unmet condition? Thanks for your help. I'm trying to traverse the list to the last node in the second part of the full() method. I implemented this stack as array based so must implement this method full() as this method is inside of main class. while(!stacker.full()) { cout << "Enter number = "; cin >> intIn; stacker.push(intIn); cout << "Pushed: " << intIn << endl; }//while Call to LinkListStack.cpp to class LinkList full(). int LinkList::full() { if(head == NULL) { top = 0; } else { LinkNode * tmp1; LinkNode * tmp2; tmp1 = head; while(top != MaxSize) { if(tmp1->next != NULL){ tmp2 = tmp1->next; tmp1 = tmp2; ++top; }//if }//while }//else return (top + 1 == MaxSize); }

    Read the article

  • Google Maps API v3 not working

    - by user1496322
    I've been banging my head on the wall after going through the documentation on this several times! I can't seem to get past the API error to get the map to appear on my site. I am getting the following error message from the web page where I want the map to be displayed: ~~~~~~~~~~~ Google has disabled use of the Maps API for this application. The provided key is not a valid Google API Key, or it is not authorized for the Google Maps Javascript API v3 on this site. If you are the owner of this application, you can learn about obtaining a valid key here: https://developers.google.com/maps/documentation/javascript/tutorial#Obtaining_Key ~~~~~~~~~~~ I have (several times now) gone into my account and 1) enabled the Maps v3 API service. 2) Generated a new API key. and 3) added my allowed referrers to the key. (both www.domain.com and domain.com URLs) I have the following added to the head of the web page: < script src="http://maps.googleapis.com/maps/api/js?sensor=false&key=MY_API_KEY_HERE" type="text/JavaScript" language="JavaScript" And... I have the following javascript function that executes when a link is clicked on the page: alert("viewMap()"); var map = new GMap3(document.getElementById("map_canvas")); var geocoder = new GClientGeocoder(); var address = "1600 Amphitheatre Parkway, Mountain View"; alert("Calling getLatLng ..."); geocoder.getLatLng(address, function(point) { var latitude = point.y; var longitude = point.x; // do something with the lat lng alert("Lat:"+latitude+" - Lng:"+longitude); }); The initial 'viewMap' alert is displayed and then is followed by the 'Google has disbled use...' error message. The error console is also showing 'GMap3 is not defined'. Can anyone please assist with showing me the errors of my ways?!?!? Thank you in advance for any help you can provide. -Dennis

    Read the article

  • text-transform cannot change/be overwritten? (css)

    - by Radek
    I am studying css and I do not understand why some OTHER text and line 2 has red underline effect on them. I thought I either changed it for class others or reset it to none for class line2 I tried `text-decoration:none' for both .line2 and .others and the text was still red underlined. <html> <head> <style type="text/css"> .line {color:red; text-transform:uppercase; text-decoration:underline;} .line2 {color:blue; text-transform:none;} .others {color:black; text-transform:lowercase; text-decoration:blink; font-weight:bold;} </style> </head> <body> <div class='line'> line 1 <div class='others'><BR>some OTHER text<BR></DIV> <div class='line2'> <BR>line 2 </div> </div> </body> </html>

    Read the article

  • IE6 transparency+radio button can't be clicked

    - by Jonas Byström
    IE6: when I place a partially transparent image in a div, the radio buttons in that div that overlap the non-transparent pixels of the image become unclickable. Example: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <style media="screen" type="text/css"> div { position: relative; width: 500px; height: 300px; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=http://upload.wikimedia.org/wikipedia/commons/thumb/f/fc/Olympic_flag_transparent.svg/200px-Olympic_flag_transparent.svg.png, sizingMethod='crop'); } input { position: absolute; top: 40px; left: 60px; } </style> </head> <body> <div> <input type="radio" value="1" name="1"/> </div> </body> </html> If you test the code, you can also try moving the button from (60, 40) to (40, 40) where the image is transparent, and voilà - the clicking is back in business again. This bug might, or might not, be related to the IE6 links transparency bug, but I'm not knowledgable enough to grasp any resemblence. Have I done something wrong? Or how can I circumvent? Is there some other option apart from removing the _filter:progid?

    Read the article

  • ASP.NET MVC3 - Bug using Javascript

    - by ebb
    Hey there, I'm trying to use Ajax.BeginForm() to POST A Json result from my controller (I'm using MVC3). When the Json result is called it should be sent to a javascript function and extract the object using "var myObject = content.get_response().get_object();", However it just throws a "Microsoft JScript runtime error: Object doesn't support this property or method" when trying to invoke the Ajax POST. My code: Controller: [HttpPost] public ActionResult Index(string message) { return Json(new { Success = true, Message = message }); } View: <!DOCTYPE html> <html> <head> <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/MicrosoftAjax.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/MicrosoftMvcAjax.js")" type="text/javascript"></script> <script type="text/javascript"> function JsonAdd_OnComplete(mycontext) { var myObject = mycontext.get_response().get_object(); alert(mycontext.Message); } </script> </head> <body> <div> @using(Ajax.BeginForm("Index", "Home", new AjaxOptions() { HttpMethod = "POST", OnComplete = "JsonAdd_OnComplete" })) { @Html.TextBox("message") <input type="submit" value="SUBMIT" /> } </div> </body> </html> The strange thing is that the exactly same code works in MVC2 - Is this a bug, or have I forgot something? Thanks in advance.

    Read the article

  • JAVASCRIPT - What am I doing incorrectly?

    - by DarkLightA
    LIVE CODE: http://jsfiddle.net/vy4nY/ I'm following this challenge, but I'm having some issues. I'm trying to make the Email Address box only appear when the checkbox is clicked on. What have I done incorrectly? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <title>JavaScript Challenges</title> <style type="text/css"> #emailpara {visibility:hidden;} </style> </head> <body> <form action=""> <fieldset> <legend>Email subscriptions</legend> <p id="subscribepara"> <label> <input type="checkbox" name="subscribe" id="subscribe"> Yes! I would like to receive the occasional newsletter via email. </label> </p> <p id="emailpara"> <label> Email Address: <input type="text" name="email" id="email"> </label> </p> </fieldset> </form> <script type="text/javascript"> document.getElementById('subscribe').onclick = (document.getElementById('subscribe').checked ? (document.getElementById('emailpara').style.visibility = 'visible') : (document.getElementById('emailpara').style.visibility = 'hidden')); </script> </body> </html>

    Read the article

  • How to make an AJAX call immediately on document loading

    - by Ankur
    I want to execute an ajax call as soon as a document is loaded. What I am doing is loading a string that contains data that I will use for an autocomplete feature. This is what I have done, but it is not calling the servlet. I have removed the calls to the various JS scripts to make it clearer. I have done several similar AJAX calls in my code but usually triggered by a click event, I am not sure what the syntax for doing it as soon as the document loads, but I thought this would be it (but it's not): <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script type="text/javascript"> $(document).ready(function(){ $.ajax({ type: "GET", url: "AutoComplete", dataType: 'json', data: queryString, success: function(data) { var dataArray = data; alert(dataArray); } }); $("#example").autocomplete(dataArray); }); </script> <title></title> </head> <body> API Reference: <form><input id="example"> (try "C" or "E")</form> </body> </html>

    Read the article

  • How do you prevent Git from printing 'remote:' on each line of the output of a post-recieve hook?

    - by Matt Hodan
    I recently configured an EC2 instance with a Git deployment workflow that resembles Heroku, but I can't seem to figure out how Heroku prevents the Git post-receive hook from outputting 'remote:' on each line. Consider the following two examples (one from my EC2 project and one from a Heroku project): My EC2 project: git push prod master Counting objects: 9, done. Delta compression using up to 2 threads. Compressing objects: 100% (5/5), done. Writing objects: 100% (5/5), 456 bytes, done. Total 5 (delta 3), reused 0 (delta 0) remote: remote: Receiving push remote: Deploying updated files (by resetting HEAD) remote: HEAD is now at bf17da8 test commit remote: Running bundler to install gem dependencies remote: Fetching source index for http://rubygems.org/ remote: Installing rake (0.8.7) remote: Installing abstract (1.0.0) ... remote: Installing railties (3.0.0) remote: Installing rails (3.0.0) remote: Your bundle is complete! It was installed into ./.bundle/gems remote: Launching (by restarting Passenger)... done remote: To ssh://[email protected]/~/apps/app_name e8bd06f..bf17da8 master -> master Heroku: $> git push heroku master Counting objects: 179, done. Delta compression using up to 2 threads. Compressing objects: 100% (89/89), done. Writing objects: 100% (105/105), 42.70 KiB, done. Total 105 (delta 53), reused 0 (delta 0) -----> Heroku receiving push -----> Rails app detected -----> Gemfile detected, running Bundler version 1.0.3 Unresolved dependencies detected; Installing... Using --without development:test Fetching source index for http://rubygems.org/ Installing rake (0.8.7) Installing abstract (1.0.0) ... Installing railties (3.0.0) Installing rails (3.0.0) Your bundle is complete! It was installed into ./.bundle/gems Compiled slug size is 4.8MB -----> Launching... done http://your_app_name.heroku.com deployed to Heroku To [email protected]:your_app_name.git 3bf6e8d..642f01a master -> master

    Read the article

  • How to access child div elements under a given condition with javascript?

    - by hlovdal
    My main question is to calculate the last alert message, but any other information is also welcome. I am trying to learn javascript (to use with greasemonkey later), but I am struggling a bit to grasp the DOM and how to process it. <html> <head> <script type="text/javascript"> function my_test() { var elements = document.getElementsByTagName("div"); // prints "found [object HTMLCollection] with length 8" alert("found " + elements + " with length " + elements.length); // prints "0:[object HTMLDivElement]" alert("0:" + elements[0]); // how to calculate the following? alert("for intereting one is AAAA and three is CCCC"); } </script> </head> <body> <div class="interesing"> <div class="one">AAAA</div> <div class="two">BBBB</div> <div class="three">CCCC</div> </div> <div class="boring"> <div class="one">1111</div> <div class="two">2222</div> <div class="three">3333</div> </div> <input type="button" onclick="my_test()" value="my test" </body> </html> So elements is now an array of elements and I can access each of them individually. But where can I find what methods/properties these elements have?

    Read the article

  • Clicking inside a polygon in Google Maps

    - by amarsh-anand
    The included JavaScript snippet is supposed to do the following: As the user clicks on the map, initialize headMarker and draw a circle (polygon) around it As the user clicks inside the circle, initialize tailMarker and draw the path between these two markers 1 is happening as expected. But as the user clicks inside the circle, in the function(overlay,point), overlay is non-null while point is null. Because of this, the code fails to initialize tailMarker. Can someone tell me a way out. GEvent.addListener(map, "click", function(overlay,point) { if (isCreateHeadPoint) { // add the head marker headMarker = new GMarker(point,{icon:redIcon,title:'0'}); map.addOverlay(headMarker); isCreateHeadPoint = false; // draw the circle drawMapCircle(point.lat(),point.lng(),1,'#cc0000',2,0.8,'#0',0.1); } else { // add the tail marker tailMarker = new GMarker(point,{icon:greenIcon,title:''}); map.addOverlay(tailMarker); isCreateHeadPoint = true; // load thes path from head to tail direction.load("from:" + headMarker.getPoint().lat()+ ", " + headMarker.getPoint().lng()+ " " + "to:" + tailMarker.getPoint().lat() + "," + tailMarker.getPoint().lng(), {getPolyline:true}); } });

    Read the article

  • How to do drag-n-drop and resize on an image using jQuery?

    - by Scott
    How do I resize and image using jQuery but keep its aspect ratio the same? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>CrossSlide - A jQuery plugin to create pan and cross-fade animations</title> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> </head> <body> <style type="text/css"> #resizebleImage { background: silver; } </style> <script type="text/javascript"> $(document).ready(function(){ $("#resizebleImage").resizable().parent().draggable(); }); </script> <img id="resizebleImage" src="http://images.askmen.com/galleries/singer/gloria-estefan/pictures/gloria-estefan-picture-4.jpg"> </body> </html>

    Read the article

  • What is the performance impact of CSS's universal selector?

    - by Bungle
    I'm trying to find some simple client-side performance tweaks in a page that receives millions of monthly pageviews. One concern that I have is the use of the CSS universal selector (*). As an example, consider a very simple HTML document like the following: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Example</title> <style type="text/css"> * { margin: 0; padding: 0; } </head> <body> <h1>This is a heading</h1> <p>This is a paragraph of text.</p> </body> </html> The universal selector will apply the above declaration to the body, h1 and p elements, since those are the only ones in the document. In general, would I see better performance from a rule such as: body, h1, p { margin: 0; padding: 0; } Or would this have exactly the same net effect? Essentially, what I'm asking is if these rules are effectively equivalent in this case, or if the universal selector has to perform more unnecessary work that I may not be aware of. I realize that the performance impact in this example may be very small, but I'm hoping to learn something that may lead to more significant performance improvements in real-world situations. Thanks for any help!

    Read the article

  • git-diff to ignore ^M

    - by neoneye
    In a project where some of the files contains ^M as newline separators. Diffing these files are apparently impossible, since git-diff sees it as the entire file is just a single line. How does one diff with the previous version? Is there an option like "treat ^M as newline when diffing" ? prompt> git-diff "HEAD^" -- MyFile.as diff --git a/myproject/MyFile.as b/myproject/MyFile.as index be78321..a393ba3 100644 --- a/myproject/MyFile.cpp +++ b/myproject/MyFile.cpp @@ -1 +1 @@ -<U+FEFF>import flash.events.MouseEvent;^Mimport mx.controls.*;^Mimport mx.utils.Delegate \ No newline at end of file +<U+FEFF>import flash.events.MouseEvent;^Mimport mx.controls.*;^Mimport mx.utils.Delegate \ No newline at end of file prompt> UPDATE: now I have written a script that checks out the latest 10 revisions and converts CR to LF. require 'fileutils' if ARGV.size != 3 puts "a git-path must be provided" puts "a filename must be provided" puts "a result-dir must be provided" puts "example:" puts "ruby gitcrdiff.rb project/dir1/dir2/dir3/ SomeFile.cpp tmp_somefile" exit(1) end gitpath = ARGV[0] filename = ARGV[1] resultdir = ARGV[2] unless FileTest.exist?(".git") puts "this command must be run in the same dir as where .git resides" exit(1) end if FileTest.exist?(resultdir) puts "the result dir must not exist" exit(1) end FileUtils.mkdir(resultdir) 10.times do |i| revision = "^" * i cmd = "git show HEAD#{revision}:#{gitpath}#{filename} | tr '\\r' '\\n' > #{resultdir}/#{filename}_rev#{i}" puts cmd system cmd end

    Read the article

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