javascript

help me write a bookmarklete that counts word frequency

I want to create a bookmarklete that counts up all the text on a webpage and then displays the results from most to least it in a absolutely positioned div. Every google search i've done talks about counting the total number of words in a form or text area or known div id. That's not what i want. I want the number of times each /w app...

Creating Audio using Javascript in <audio>

I can't find anything through net searches, but is there any plans to make an API to generate audio chunks to be played in an HTML5 <audio> tag? EDIT: this is the example:: PSEUDOCODE:: var music = new Song([Array of hertz levels or notes]); var box = document.createElement('audio'); document.body.appendChild(box); box.src = music.conv...

Insert html using jquery .html()

I want to insert a large chunk of html into a pre-existing <td>. I am using this method: $("td#content").html(LOTS_OF_HTML_CODE_HERE); But it doesn't work. I am a noob, there are a lot of quotes and ' within the HTML chunk that seems to be breaking it. What is the correct method for doing this? ...

What kind of algorithm makes a curve like this (img) & can it be done in javascript for flot?

And can you give me an example of an algorithm? EDIT: And then how would I calculate the math using Javascript? Can someone add that? Sorry to not include that context originally.. NOTE: I am using 'flot' to graph it and the input for flot is a javascript array like this: [[x,y],[x,y],[x,y]...] So given the values that change the cu...

Google Maps API sometimes not returning PostalCode within AddressDetails

I created a function to take location input, pass it to Google Maps Javascript API V2, and return a latitude/longitude/normalized address that I'll have to split into different fields in a database (i.e. city, state, postal). I'm requiring at least a level 5/post code accuracy for the input so that the returned data from Google will alw...

JQuery children element set event

Im trying to create an event for each (a) element in a list (ul). But im doing something wrong function EnableAjaxOnMenu(ElementID, TagName) { var elm = jQuery("#" + ElementID).children(TagName).click(function () { GetPageByUrl(jQuery(this).attr("href")); //ChangeSelectedMenuItem(this); return false; })...

Javascript makes browser load forever and crash Safari.

Hi I'm trying to make a little script that'll inject a tag in a page. Here it is: <script type="text/javascript" charset="utf-8"> var url = 'http://my_url.com/js/widget_rss.js?cle=4c65683101e22&amp;host=' + window.location.hostname; var scriptTag = document.createElement('script') scriptTag.src = url; var head = d...

How to make a P2P streaming using a web browser?

I want to create an application for P2P video transmission. In more details, I need the following: User can switch on a web camera by clicking a button in an application. Application starts to take images from the web camera and sends them to a certain location (given by a port and IP address). Application starts to accept images send ...

Problem passing integer variable into click event in javascript and jquery

This is probably something simple but it's driving me nuts. I'm making some pagination using jquery and a while loop which has a variable called "pageNum" that updates at the end of the loop and represents the page being written out. Obviously pageNum is added to at the end of each iteration. Fine. Here's the code that's giving me a ha...

What is a "Javascript Bootloader" ?

I have seen this mainly in the source of Facebook "Bootloader.setResourceMap({"bMxb7":{"name":...." What is exactly a bootloader in javascript? what is its use and purpose? Thank you =) ...

JQuery UI, Combining Sortable with Droppable

Hello! I am trying to combine JQuery UI sortable with droppable to create multiple pages for dropping and sorting things. I have setup a standalone demo: http://whit.info/dev/sortdrop/ and here is a jsFiddle: http://jsfiddle.net/VUuyx/ Note that you can drag to sort the boxes, even into other columns. You can also click the page but...

JavaScript: pass arguments to onclick handler.

I need to pass extra arguments to onclick handler. I can't decide which way is "better": EDIT: Context: I have a table that shows roster of an event. Each row has a 'delete' button. What is a better way to pass recordId to the delete-handler? $('a.button').click(function() { var recordId = $(this).metadata().recordId; console.l...

How can i draw polygons on an HTML5 canvas through a JavaScript function

i want the user to be able to click somewhere on the canvas and the polygon will appear on it <DIV id="canvasarea" class="rounded"> <CANVAS id="canvas" width="800px" height="800px"></CANVAS> </DIV> ...

__doPostBack is not defined

Im getting that error when try to call a __doPostBack on one of my pages, every page that i have in the project use __doPostBack function but in this particular page im getting that Javascript error. i was looking in the internet and the only thing i read is that this error happends when i have a unclose tag but i review the site and i...

combining css and js files + css images

I'm playing with this combine.php file and it looks nice, but I'm wondering if there is a work around for my problem. I now have fewer script and link tags for my resources that look and work like they're supposed to <script type="text/javascript" src="http://path/to/server/javascript/libjs/jqueryui/1.8/development-bundle/ui/minified/j...

Best practice for organizing JavaScript coming back from Ajax calls

I am writing an application (Asp.Net MVC) that contains a lot of reusable components. I am currently loading these components with Ajax calls, using the jQuery library of course. These components will be calling other sub-components as well, and so there are all these JavaScript coming back. So question is, where should I put the "ca...

PHP/JS: Disable form´s action if enter

Hey, so my form is where you register you as a user. You type in 2 fields then press next and then 3 new fields come and then it runs the action="index.php?register=yes". Now as you can see i highlighted "then press next" thats because, maybe some users just press enter after typing in the last field, and then it runs the action. But i...

Looking for a good JQuery counter

Hello. I have a website that has members. I want to create a feature that is a real time (with out page load ) counter of how many members are signed in. I have the signed in user in a variable so I'm looking for someway to incorporate it using that. Anyone know of a good plug-in or Jquery script to do this? thanks in advance ...

javascript + google mashups, remove drawn objects

hi, here is an example of drawing polygons on google mashups. Can anyone show how to do the following: 1) Only let user only draw one object. 2) If user has drawn the object, and then presses again on some other object button then the previous object on google mashup is deleted. So that there is only one object always on google mashup.....

Preventing the Android "long press" to save images

I've written a web-app in HTML and Javascript for iPhone and Android which involves the dragging and dropping images. You initiate the drag by holding your finger over the image for about a second. However, Android then pops up the message giving me the option to save the image, set it as wallpaper etc. How can I prevent Android from ...