javascript

Link to retrive pdf file from DB- in asp.net

i have retrived the pdf file from Database and i linked it to a tag to open pdf file using link. now i want to give the open/save dialog box before a pdf file opened . - in javascript(by using onclick event in tag to call the javascript) ...

Google Maps API : Display a digit in a GMarker

Hello, How can I display a digit inside the GMarker ? I used title, but it is only on rollover like title on links or image. Do you have any idea how I can do that ? ...

jQuery syntax question : ul as variable, remove item?

This is a simple syntax question. I have a ul saved as a variable like this: $list = $("#city_list"); I am later removing some items from the list with this code: $('ul#city_list li#city_' + $id).remove(); How can I do that using the $list variable I created earlier so that I get something like this: $list.('li#city_' + $id).remo...

Issue with Geocoding in Google Maps API

Hello, Im trying out the Google Maps API Geocoding feature.The map loads fine, but im facing an issue with geocoding.I have a text box on the page where i enter the location, and on clicking the submit button, i would like to pinpoint the entered location on the map. The setCenter method correctly marks the location on the map, first t...

Checking input elements on Firefox with JavaScript

I'm developing an extension, which listens to click events on elements. Now I have two questions: Is there a convenient way to detect whether an element is an input element? Like input, textarea in HTML, and textbox in XUL. If the user clicked on an input element, how to get the position where the user clicked? For example, there's an...

How Can I Get the Arguments of Function Calls from the Firebug Profiler?

Firbug profiler outputs the functions called, but not the arguments/parameters of each function call. Is there any way to get those arguments? I've dug through the DOM tab for any of the given function calls that I know would have to have had some arguments, but was unsuccessful in pulling out any details. ...

change text color on change of selection in dropdown list

I have a drop-down list of colors, and when selected, i want to change a value of css font color to the value of the selection. How can i do this? <select name="color"> <option value="white" selected="selected">white</option> <option value="black">black</option> <option value="red">red</option> <...

What is the best way to test for an empty string with jquery-out-of-the-box?

Hi! What is the best way to test for an empty string with jquery-out-of-the-box? I.e., without plugins. I tried this: http://zipalong.com/blog/?p=287 But it did't work at least out-of-the-box. It would be nice to use something that's builtin. I wouldn't like to repeat "if (a == null || a=='')" everywhere if some "if (isempty(...

An issue concerning MouseEvents

I'm now catching mouse click events on textarea elements. Since I have to stop propagation after processing the event, the caret will not be set as usual when we use click on the textareas with middle key. But I need to set it before doing further works, so I tried to dispatch a mouse event manually. My code is: var evt = document.cre...

Javascript bitwise problem

Hi, I have a problem while using bitwise in javascript. I don't know if I'm going about this the wrong way. But here goes. I have 4 main categories. With id 1,2,4,8. A item in my object has a property with the total of the categories it's a member of. ie. { item: { name: 'lorem', c: 7 }} //member of category 1,2,4 I have variable ...

Prototype Ajax.Updater Eval Javascript Functions

I have this sample page: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Ajax Page</title> <script type="text/javascript"> function ajax_hello() { alert ("hello"); } alert ("Hello from JS"); </script> </head> <body> This is the Ajax page. <a href='#' onclick='ajax_hello();'>Click here to fi...

beforeSend in $.getJSON

How do I use beforeSend callback in $.getJSON(cross domain). More specifically $.getJSON is call is to a YQL service Like select * from html where url=”http://www.yahoo.com” ...

Static text within text field?

How can i keep static text within a <input type="text" name="site"> text field, just like the tumblr account ***.tumblr.com here > http://www.tumblr.com/ ...

JavaScript: Mouse Events

I am trying to bind an event on the 'mousedown' event type so as to trigger the 'mousemove' event and keep it running till the 'mouseup' event happens (i.e. the 'mousemove' event must continue as long as the mouse button is kept pressed). The 'mousedown' event must take place within a div box, but the 'mousemove' and 'mouseup' events may...

Javascript on embedded videos

Hi, Is it possible to use javascript to seek position of videos embedded on a page (Videos from Youtube, DailyMotion, Revver, etc)? Thanking you in advance. Regards Mansoor ...

components.Classes["THISPART"]

When you need to create or access well-known objects in XPCOM, where do you find their contract IDs? ...

Using HTML tags in JavaScript strings while complying with W3C rules

Here's my code: <a href="#"> <img src="myimage.jpg" onmouseover="showDescription( 'Text', 'Text with HTML tags in them<br />More text');" onmouseout="revertDescription();" alt="Image description"> The W3C Markup Validator doesn't like this. It doesn't want HTML tags inside my JavaScript code. Here's the...

Create a modular website, allowing the user to select their page layout. PHP and jQuery advice?

Hello, I am looking to build a website that allows the user to fully customise the content that they see. I will be building this using CodeIgniter or Zend Framework and also jQuery. What I need to know and gain some advice on is how is the best way to create the content on the fly, When a user selects that they would like the blog s...

Adding javacript in Datalist

That's my code but that says not well formed.... How can i correct that? <ItemTemplate> <asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("Name") %>' onClick="<%#"javascript:popUp(\'gallery_detail.aspx?cat_id=\""+ Eval("ID") +"\"\')"%>"></asp:HyperLink> <br /> <br /> </ItemTemplate> ...

Is it possible to create a div element with jquery onclick of a link

Hi, I have a navigation list, the effect I am wanting is for when the user clicks on a link an accodian style div is built and displayed by jquery, then if the user clicks the same screen the is deleted from the screen, could someone suggest how this could be achieved I have been searching google with no luck. Thanks ...