javascript

how to view associated click function code

For example, i associate following function with some element $('table#users tbody tr:first #save').click(function(){ $(this).closest('tr').remove(); }); Now, if i don't know where this function is stored, is there a way to view associated with click() code? In above example, i want a way to view that in firebug, or in another way...

how would one block the selecting of text or change the cursor to the pointer over certain text

i have a button in html that has a background image and text overtop of it, how can i disable the selecting of that text so it looks more "seamless"? echo '<td width="130" height="30"'. "onClick='document.location = ".'"'.$value.'";'."'><center>".$key."</center></td></a>"; ...

How to read a file line using php in a javascript variable without the breakline character ?

I have a txt file on the server which contains 10 lines of text. The text file is rewritten sometimes, and I get new lines using "\r\n". My problem shows when I want to load the lines in javascript variables. I do it like this, but this work only for numbers or for the last line of the file, because its not using the breakline tag: var x...

jqTouch/JavaScript alerts - how to remove the title?

Looking to have some alerts/prompts pop up in my iPhone web app but I see the Title is at the top of the alert (I understand this is the normal behavior). My question is can I remove this? or use an alternative solution. Looking for something that looks like the push notification alert but in JavaScript. ...

SimpleModal load external HTML page in dialog

Is it possible to load an external HTML file into a variable and then use this variable to load the SimpleModal dialog? Something like this: $(document).ready(function($) { var externalPage $.get("Renderer.htm"); $('#basic-modal .basic').click(function(e) { $(externalPage).modal(); return false; }); }); A...

Using Javascript to flip flop a textbox's readonly flag

I have a frame with several radio buttons where the user is supposed to select the "Category" that his Occupation falls into and then unconditionally also specify his occupation. If the user selects "Retired", the requirement is to prefill "Retired" in the "Specify Occupation" text box and to disable it to prevent it from being changed...

OpenLayers, Bing and a KML

Hi! I'm trying to lay an KML over VirtualEarth Map in OpenLayers, but it doesn-t work. I guess it has to be something with the projection. Map: var options = { controls: [ new OpenLayers.Control.KeyboardDefaults(), new OpenLayers.Control.MouseDefaults(), new OpenLayers.Control.PanZoomBar(), ...

Building a Hashtag in Javascript without matching Anchor Names, BBCode or Escaped Characters

I would like to convert any instances of a hashtag in a String into a linked URL: #hashtag -> should have "#hashtag" linked. This is a #hashtag -> should have "#hashtag" linked. This is a [url=http://www.mysite.com/#name]named anchor[/url] -> should not be linked. This isn&#39;t a pretty way to use quotes -> should not be linked. Here ...

Mouseover - mouseout - Javascript

what i'm trying to do: When a user hovers over an image, a little x (image) should appear in the top right corner. If the user clicks on this little x the image should be deleted and when the user does a mouseout the little x should dissapear. I've tried several things: html structure is an ul with li's and an image in it Javascript: ...

Disabled javascript for printing?

This may seem a strange question, but is it possible to disable javascript for the printed version of a webpage? The reason being, it causes the printout's layout to all be on top of each other. But if I turn off javascript it works fine. Any ideas? ...

Updating form values with javascript

This works, does anyone see anything I shouldnt be doing? My funtion that is called function getWeight(){ var weight; var quantity = document.dhform.quantity.value; var cardSize = document.dhform.cardSize.value; weight = quantity * cardSize; document.rates.weight.value = weight; } take...

Best way to detect that HTML5 <canvas> is not supported

The standard way to deal with situations where the browser does not support the HTML5 <canvas> tag is to embed some fallback content, usually a polite version (and sometimes a less polite version) of <canvas>Your browser sucks</canvas> But the rest of the page remains the same, which may be inappropriate or misleading. I'd like some w...

Simple getJSON does not work...

JSON function(Index) does not fire. Any Ideas? <script type="text/javascript"> $(document).ready(function() { alert("This alert is displayed :("); $("form[action$='GetQuote']").submit(function() { $.getJSON($(this).attr("action"), $(this).serialize(), function(Result) { a...

Invalidate static content for remote requests?

I'm currently working on some javascript that will be embedded on a customer's page. The javascript makes a request back to our servers and then self-assembles on the customer's webpage when it gets a visitor. How do I ensure caches are updated when we push changes to our static content? The way I would normally do this is to attach a ti...

Dynamically replace HTML element in UIWebView

I have some HTML loaded in WebView like this: <html><head></head><body>before <myTag>Content</myTag> after</body></html> I want to replace element myTag with custom text so it should look like: <html><head></head><body>before ____MY_CUSTOM_TEXT___ after</body></html> Also I can't change initial HTML. How I can do this with ...

Only perform jquery effects/operations on certain pages

Up until now i've been dropping all my jquery code right inside the document.ready function. I'm thinking that for certain situations this isnt the best way to go. for example: If i want an animation to perform when a certain page loads what is the best way to go about that. $(document).ready(function() { $("#element_1").fadeIn();...

Why not always use https when including a js file?

For what reasons do sites provide logic to switch between http/https protocols for JavaScript include files? Why not always use https? ...

Is there a way to force a user to scroll to the bottom of a div?

I don't need to auto-scroll to the bottom of a div, rather force the user to scroll there themselves. I've got a legal agreement that I'd actually like people to read. Possible using regular JS or jQuery? ...

What's the easiest way to add flash to an html page to use with Jquery?

Is there a method in Jquery to add a flash movie easily? ...

What is a good book for Object Oriented jQuery?

I want to improve my JavaScript so I thought it'd be a good idea to get a book on Object Oriented JavaScript. But I also use a lot of jQuery so I'm looking for a book that approached OO JavaScript from a jQuery point of view ...