javascript

jquery $.get(...) one at a time

i have a page with many actions on it, which triggers with $.get, but i want to run one at a time, rather then all triggering at once, that is lots of load time.. so what is the solution for me on this? well before you give answer.. i dont want to trigger based on time, i want to trigger after each request is completely done from ajax, ...

How do I get label value as a parameter into a javascript function?

Hopefully this one is not too hard to understand but I just want the label values to be inputs into a javascript function. Might be better to explain with code: ASP.NET Label code: <asp:Label ID="LabelCL" runat="server" Text="A single int filled in by DB"></asp:Label> Page Source: <span id="ctl00_cpMainContent_LabelCL">7</span> ...

Copy a table to new window

I'm trying to open up a new browser window, and copy a table from the parent window into this new window. I'm using Prototype.js and this is the code I have: prog_window = window.open(); prog_window.document.write("<html><body></body></html>"); table_clone = Element.clone('prog_table',true); prog_window.document.addElement(table_clone)...

Canvas - Getting Image Position

Hi, I am using canvas,and I have this code - var myCanvas = document.getElementById("myCanvas"), ctx = null; // Check for support - Feature Support and not Browser Support if ( myCanvas.getContext) { // Getting the context future 3d ^_^ ctx = myCanvas.getContext("2d"); var googleLogo = ...

Reading an element's height property as a string with alert()

This is pretty rudimentary, but I want to know how I can access a property like height as a string. The mouseover alert here simply returns "undefined" (and saying height.value in the alert doesn't help either): <html> <body> <div id="wut" align="center" height="10" onmouseover="alertheight()"> hi. </div> <script type="text/j...

using Qooxdoo components without using the whole framework?

Is Qooxdoo only usable if you want to write your entire application with it? I would only like to use the table component. Kind of like Extjs building its own grid component after you register which table element you'd like it to transform. ...

Using Ext.data.Connection for a Form Load Action

I have created a custom extension of Ext.data.Connection that adds in a couple of headers for all my Ajax requests. I'd like to use the same Connection class to submit a form similar to below, but it seems the http://www.sencha.com/deploy/dev/docs/?class=Ext.form.Action has its own configuration. var conn = new MyCustom.Request({ ...

Javascript Try-Catch Performance Vs. Error Checking Code

Hello everybody! Would it be faster to just put code inside a try-catch block instead of performing various error checks? For example.. function getProjectTask(projectTaskId) { if (YAHOO.lang.isUndefined(projectTaskId) || YAHOO.lang.isNull(projectTaskId) && !YAHOO.lang.isNumber(projectTaskId)) { return null; } var...

Javascript Fade-in Text on mouse-over

Hello, someone already has already posted the solution to my question, seen below. I want the same effect but only for certain parts of the page rather than all of the content. I basically only want certain parts of the page to fade in when the mouse is moved. // attach event handler document.body.onmousemove = function(){ fadeIn( thi...

In jQuery-ui, this._mouseInit is not a function error, why am I getting this after i upgrade to 1.8.2

Hi I am having trouble with my application after I upgraded to 1.8.2 jquery-ui. I am getting a "this._mouseInit is not a function error". Includes: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt; <style type="text/css" media="all">@import "css/pinpoint.css";</style> <link rel="styleshee...

What's the best way to built a JavaScript object so that it works AND passes JSLint?

I've been trying to see if I can build my JavaScript objects as intuitively as possible while making sure it's as 'correct' as possible. I've been running a bunch of different scenarios through Crockford's JSLint.com and haven't had much luck. I seem to fix one error, then another pops up because of the change. Below is about as good as ...

Force orientation on iPad - javascript

I'm building an app in the browser for the iPad and was wondering if it's possible to lock the orientation of the viewport? I've checked apple's documentation and the only thing I've found says orientation is read only : http://developer.apple.com/safari/library/documentation/DataManagement/Reference/DOMWindowAdditionsReference/DOMWindow...

I want the Jquery thing to show over adsense

Hello I need your help For example see My site page : http://scansocial.com/22478982 there you can see a jquery thing at topmost and after that adsense. When we click one of Share Tweet Shorturl on Jquery it loads into down which shows adsense in that too How to make adsense not visible over the Jquery window ? ...

Selecting states an interactive jQuery map

In my project I've included an interactive map, similar to this one : http://davidlynch.org/js/maphilight/docs/demo_usa.html <div class="event_map" style="display: block; background: url('map.png') repeat scroll 0% 0% transparent; position: relative; padding: 0pt; width: 260px; height:241px;"> <canvas width="260" height="241" style=...

Need a print button in a browser that will print a PDF file

I need to set up a print button in HTML that will print a certain PDF file, hopefully without having to download the file first. I've tried a few things but some only work in IE. and some require downloading the file as an embedded object which also is not acceptable. Embedding javascript in the PDF sounds the most promising, but I'd ra...

Javascript code analysis and best practices

Are there any tools out there to help programmers that REALLY want type safety and the more stringent rules of a language like c# or java with javascript? For example, something that say analyzed source files and found things like undeclared variables or a js file of defined type objects like int or string? ...

assign events to cloned html block

hi i am using Jquery 1.3 i have a html block in which there are many tags like input , button , hyperlink etc. now whenever i clone this block of html its events don't get copied automatically as clone() only copies html block , so i wan to know that how to assign events to cloned html block ? ...

Google Gears, replication, threading and problems

Hi all, I have recently made my first attempt at using Google Gears and performing replication to the local Sqlite database after many weeks of trial and error everything seemed to be sweet as candy. I have accomplished this using approximately 10 worker threads each of which intermittently poll a webservice and update the database as ...

jQuery, where to load functions best practice

Hi All, I am using jQuery and I am loading dynamic HTML via PHP. My question is, what is the best practice concerning elements/attributes that may or may not exist on any given page? Should I have one .js file containing all the possibilities (I would think this is inefficient) or should I use a bunch of script tags (that seems also i...

unterminated string literal Javascript

I'm using the following code in php: PHP: $suggested_sentence[0] = "Hello, how are you?"; echo $suggested_sentence[0] . ' <input type="image" src="button.png" onclick = update_textarea('. $textareacount.','. "'".$suggested_sentence[0]."')/>"; Javascript function: function update_textarea(count, new_sentence) { document.get...