javascript

Displaying scale within the range selector of a Google annoted timeline

I want to visualize where the user currently is located on the range selector slider at the bottom of the timeline. Google uses this method on the Finance site. ...

How to get the last segment with regular expression?

I have the following url. http://127.0.0.1/ci/index.php/admin/menus/edit/24 I want to get 24 from this to use in jquery/javascript. Something like this. var id=this.href.replace(/.*=/,''); this.id='delete_link_'+id; Could anyone tell me how to code this? ...

How can I include JavaScript dynamically from Flash using ActionScript?

I have a flash movie that requires some JavaScript from an include file but I'd like to be able to embed it anywhere without requiring a script tag. Is there a way to include an external JavaScript file using the ExternalInterface library so I can call the methods in the JavaScript include file later? Thanks! ...

Javascript replace doesn't work

function areaMe(area){ var barea = $('#barea').val(); if(barea.indexOf(area)!=-1){ alert ("..." + barea + "..." + area + "..."); barea.replace(area, "cu"); // remove alert ("..." + barea + "..." + area + "..."); }else{ barea+=area+' '; // inlcui } $('#barea').val(barea); } ...

How does facebook detect when a link as been PASTED

Facebook's status update input (well, contenteditable div) detects links. When typing a link it waits until the spacebar is pressed before fetching the URL. When pasting a link it fetches the URL instantly. I can already parse the url after the spacebar is pressed...but I'm not sure about detecting when content is pasted. Any solutio...

window.event.srcElement.options NOT Work on FF

window.event.srcElement.options(window.event.srcElement.selectedIndex).value only work on IE. How do it work both IE and FF? ...

slider that also magnifies around cursor

It can be difficult to use (webpage) sliders that cover a large range with fine granularity. On the one hand, it is easy to move across the range. On the other hand, it is difficult to locate the exact point one wants, assuming a fine enough granularity. I was thinking that a magnify effect around the cursor could solve this problem (a...

How to iterate a table rows with JQuery and access some cell values?

<table class="checkout itemsOverview"> <tr class="item"> <td>GR-10 Senderos</td> <td><span class="value">15.00</span> €</td> <td><input type="text" value="1" maxlength="2" class="quantity" /></td> </tr> <tr class="item"> <td>GR-10 Senderos<br/>GR-66 Camino de la Hermandad<br/>GR 88 Senderos del...

How to put an array of javascript object in a cookie?

Is it possible to put an array of Javascript objects and retrieve it again? Is there an easy way? Do I have to serialize as a String before storing them in a cookie? The next code shows what I want to achieve: writeCookie("items",[new Item(3,15.00,2,"GR-10 Senderos"),new Item(4,45,1,"GR-10 Senderos<br/>GR 88 Senderos del Jarama<br/>Cam...

Are dynamically inserted <script> tags meant to work?

I have some code where a <script type="text/javascript"> block is dynamically inserted. This block contains a function, which has an <input type="button"> element above it (also dynamically inserted) call it with the onclick attribute. However, it is not working, and Firebug says that the function is not defined when I attempt to click...

How do I detect a custom plugin in Firefox/IE/Chrome?

My team wants to build a "plugin" for firefox/chrome/IE. How do I use javascript to detect if this plugin (not extension) is installed? I would like to have a piece of javascript that can detect if a certain plugin is installed. Returns true if installed, returns false otherwise. For example...how do I get a list of plugins, and then ...

IE8 loading js on SSL pages

I am having an issue where all my js files that are loaded on a ssl page break in IE 8. Is there a technique to load them to work in all browsers and whether the page is secure or not? ...

jquery - add values from one listbox to another, but do not include blank lines?

I have some jQuery code that copies the selected values from one listbox to another: $(adPerson + " option:selected").each(function(){ $(toNames).append($(this).clone()); }); I'm trying to make sure no blank lines are added to the destination listbox, so I tried this: $(adPerson + " option:selected").each(function(){ if...

How to use jQuery to load a module when completed?

When a page is finished loading. Then I want to load a module other, smaller, inside it using jQuery. What should I do? ...

JSON, JS to Java and Vice Versa, and other languages.

I want to use JSON to represent JS objects send them to a Java program, and vice versa. I would also like to do this for other languages. C# to Java maybe? What do I use to do this? (Not sure if it is refered to as serialization or data binding) Edit: Once a Java object is represented in JSON, does this mean that JavaScript can parse...

Selector and Iterating Through a Table Within a Div

I have been working on this and cannot get this iterator to work. I have the following HTML and am trying to iterate through all rows (except the first row) and extract the values in cells (td) 2 and 3 : <div id="statsId"> <table width="220" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td widt...

Rich Text Editor

I'd like to build a rich text editor for a web site. How would I go about this? I've heard of iframe use for such a thing. Also contentEditable set to true plays a role. Could you tell me what you know about implementing a WYSIWYG editor? It would be nice... ...

build html table with jQuery xml response

Hello, I'm attempting to iterate through a response from a jQuery Ajax request (returned as XML). With that response, I'm building an HTML table with 3 columns (capable of an unlimited number of rows). Once the 4th XML node/ "company" is found, it should start a new row in the table. Any help with the JS to determine when the new row ...

In Internet Explorer, reloading a page causes an "Access denied" JavaScript error when trying to access the document object of a dynamically created <iframe>

This is a puzzling one, but I really need to find a solution. I recently posted a question about getting an "Access denied" JavaScript error when trying to access the document object of an <iframe> that was created with JavaScript (see URL below). This was caused by the document.domain property begin set in the parent document; since th...

Why can't I call a form content?

Hi, I have this simple code: <html> <body> <form name="f1"> <asp:Label name="lbl" runat="server" Text="Label" onclick="lblClick()"></asp:Label> </form> <script type="text/javascript"> function lblClick(){ document.f1.lbl.text="new text";} </script> </body> </html> It doesn't work, it gives me: Microsoft JScript runtime error: 'd...