javascript

I've heard Javascript inserts ";" automatically and that may cause problems.

Possible Duplicate: What are the rules for Javascript's automatic semicolon insertion? I've also heard that Go insert them too, but they followed a different approach How does Javascript insert semicolons while interpreting? Any reference would be helpful ...

Jquery, hide & show list items after nth item

Hey Guys, Say I have an unordered list, like so: <ul> <li>One</li> <li>Two</li> <li>Three</li> <li>Four</li> <li>Five</li> </ul> How would I, using JQuery, hide the last 2 list items and have a 'show more' link there, so when clicked upon, the last 2 list items would appear? <ul> <li>One</li> <li>Two</li> <l...

Dynamic kml google maps

I want to create a google maps app with kml, and i want to create the kml file dynamically depending on the zoom of the user. Something like google earth but in google maps (the zooming part) I tried to use the markermanager and clusterer but i have too many markers and performance on mobile devices is very bad but with kml that is not...

Javascript/CSS Tooltip that you can hover over and click

I'm looking for a javascript/css tooltip that can do the following: Shows up when you hover over some page element (such as a help icon.) Repositions itself based on the browser window (for example if it's on the far right of the page, it will show itself to the left of the page element, otherwise it'll show to the right of it. That wa...

My append() is double appending?

$('.photoSaved').click(function () { var savedPhoto = $(this).attr('id'); // create image and append the html inside <div id=#image> $("#image").append("LOL").show(); }); Why does this turn out as "LOLLOL" ? I have looked for #image anywhere in my file. #image gets used by another function too, but that doesnt execute if y...

Colorizing a dynamically loaded file

Hi! I'm using JQuery to load a file into a textarea and CodeMirror to colorize it, but it seems that they don't play along well: I can get the file to load or the textarea (with existing text) to get colorized, using one or the other, but when I first load it and then colorize it, I end up with a blank textarea. Here is the relevant cod...

How to create an Custom Object with a Custom Object?

In Javascript how would I create a Custom Object that has a property this is another Custom Object. For Example. function Product() { this.prop1 = 1; this.prop2 = 2; } function Work(values) { this.front = values.front || "default"; this.back = values.back || "default"; this.product = Product; } var w = new Work()...

How to get a list parameter from a grails view

In my view I have the following: <g:hiddenField name='expandableEducationList[${edIdx}]._deleted' value='false'/> <button onclick="dojo.byId('expandableEducationList[${edIdx}]._deleted').value='true'; getContainer(this, 'tr').style.display='none'" style="width:auto;" iconClass="minusIconS...

javascript validation inside of fb:serverfbml block

I am trying validate input from a multi-friend-selector that I have embedded like so: <fb:serverFbml> <script type="text/fbml"> <form action="http://example.com/testSubmit.php" method="POST" onsubmit="return validate(this);"> <fb:multi-friend-input name="hidden"/> <input type="submit" value="Submit"/...

Generating a PDF using a PUT operation

I have a web application that can display a generated PDF file to the user using the following Java code on the server: @Path("MyDocument.pdf/") @GET @Produces({"application/pdf"}) public StreamingOutput getPDF() throws Exception { return new StreamingOutput() { public void write(OutputStream output) throws IOException, WebA...

Char array to Int32 in Javascript

Hello, I have a char array "data" and a Int32 "dictIdFrame". I would like that dictIdFrame takes the value in ASCII (0-255) of data[i,...,i+3], I mean the four bytes become one single int32, where data[i] is the less significant and data[i+3] is the most significant in this int32. I really don't know how to do it... var data = "asdfasd...

How to find the key code for a specific key

What's the easiest way to find the keycode for a specific key press? Are there any good online tools that just capture any key event and show the code? I want to try and find the key codes for special keys on a mobile device with a web browser, so an online tool would be great. ...

navigating the dom javascript specific tag

Here it is DOM structure: <div id="some"> <a href="#" style="color:red;">NOTHIS</a> <a href="#" style="color:red;">NOTHIS</a> <h3 class="myclass"><a href="#" style="color:red;">HELLO</a></h3> </div> How can I get the value of HELLO in javascript? EDIT: Forgot, I have other anchor tags inside 'some', so I want strictly the anchor t...

Javascript Pop-Up when Mouse Hovers toward Browser Bar/Back Button

Hello, I would like to imitate this exact feature on this page. (Move mouse toward the top browser bar) http://my-personal-growth.com/personal-growth/what-anthony-robbins-teaches-about-emotions-and-meaning I guess all i need to know is how to create the hovering mouse action, the rest I should be able to handle myself. Any tutorials...

Image slider that resizes only images that are bigger than a fixed size?

I need an image slider which resizes the images only if its needed (the size of the image is bigger than the div containing the slider). I've tried with AnythingSlider, but when I set the width and height to the div containing the slider, the images that are smaller than the div are stretched. I don't want them to be stretched. ...

Echoing the "then" state of variable in a mootools event even after var has changed

Let's take some pseudo-Mootools code: for loop (i) from 0 to 5 { create.element { id: 'element_'+i } $('element_'+i).addevent.click { alert(i); } } The events get added to the elements properly. However, when clicked, they'll all alert the latest iterator... which would be 5. Is there any way I can cha...

google maps API V3 -> how to move map automatically when dragging a marker

When you have a draggable marker in the gmaps API V2 and drag the marker over the bounds of the map, the map moves automatically. Thats not the case in gmaps API V3. When you move a marker over the bounds, the marker disappears behind the map. How to solve this? I could not find any options at the docs. Thanks in advance. ...

Prototype Hover Content and Children

I am using: Event.observe(window, 'load', function() { $$('li').invoke('observe', 'mouseover', function(event) { this.children[0].toggle(); }); $$('li').invoke('observe', 'mouseout', function(event) { document.children[0].toggle(); }); }); <ul> <li> <div style="display:hidden;">Hidden Div</div> <div>More...

How to link to database with coordinates to a Google Map

I have a huge database with geo-coordinates like -73.9637,40.7683 + a Google Map which shows some part of our world. Now, how to select all coordinates from my database which fit into the part of the map i can see? (Do i get a range from google? how to work with this range?) ...

Showing the picture a user just picked?

Our webform has a file upload, and just a regular picture box on it. Now we already have the code to save the pictures and retrieve them, but how would you display the picture they selected without first saving it, then refreshing the page and displaying it? Is this a javascript thing? Thanks in advance. ...