javascript

How to reset netscape.security.PrivilegeManager.enablePrivilege?

At same point, I believe I've clicked the "Deny" button when the message box appeared in FireFox asking me if I wanted to allow a site a privilege using the netscape.security.PrivilegeManager.enablePrivilege() method. Now, I cannot find how to reset this so that the message box will start appearing again at this specific site. I've c...

javascript substring help.

I have a string "2500 - SomeValue". How can I remove everything before the 'S' in 'SomeValue'? var x = "2500 - SomeValue"; var y = x.substring(x.lastIndexOf(" - "), // this is where I'm stuck, I need the rest of the string starting from here. Thanks for any help. ~ck ...

Hide/Remove a tag after X seconds with jquery

Hi I am wondering how can I hide/remove a tag after a certain amount of time. Is there some built in thing or do I do use threading(if javascript can do this?) ...

Ajax pop up box using Ruby on Rails

Hi, This is a pretty basic question but I can't find a good answer for it. I have a page in my Rails app where there are many objects that can be 'flagged'. Clicking the flag button should display a little box with a confirmation, little form, etc. The trouble is I can't figure out how to do this using RJS templates. I've been usin...

How to replace innerHTML of a div using jQuery?

Hi, How could I achieve the following using jQuery, i.e: document.all.regTitle.innerHTML = 'Hello World'; where regTitle is my div id. Thanks. ...

redirect user to current page with some querystring using javascript

Hi, When a person clicks on a link, I want to do this: grab the text from a textbox encode the text redirect to currentpage.aspx?search=textboxvalue I have this so far but its not working: window.location.href = "?search=" + escape( $("#someId").val()); ...

Application fails to dynamically _re_load JavaScript files

Hello people.. I have research about an issue and could not find a solution for it through normal JavaScript techniques (maybe there is but I did not find any). The thing is, my application loads ( inserts) JavaScript files whenever the user loads a section of the system. The problem comes when I try to unload ( removal) one. I've not...

jqGrid unable to load xml data from server

I'm using jqGrid 3.5.2 and having issue with loading xml file from server side. BTW I have found a similar post arround, but didn't help much though. Here is my client Side code: $(”#list4″).jqGrid({ url:'http://localhost/cgi-bin2/test.pl', datatype: 'xml', mtype: 'GET', height: 400, colNames:['No','Date'], colModel:...

IE Dynamically Added Button Not Calling On Click

I have some code that dynamically creates a new button through JavaScript that when clicked calls a JavaScript function. The code works just as expected in Firefox, Chrome, Opera but low and behold, it doesn't work in IE(7 - I'm not even going to bother with IE6). The button gets created and appears, but it's not calling the onclick ev...

Checking an empty tag in POST -field by Javascript

How can you check an empty tag -field by Javascript like in asking questions at SO? I would not like to pass the user to send a question without specifying the tag. ...

alfresco ---- how to add event handler into surf template ?

<div class="yui-gd"> <div class="yui-u first"><label for="${args.htmlid}-addContent">${msg("label.HowToAddContent")}:</label></div> <div class="yui-u"> <select id="addContent" name="addContent" onchange="dropdown(this)"> <option value="1" selected="selected">${msg("label.ge...

Noobie Jquery Question - Why doesn't this simple script work?

Hello! I'm learning JQuery and I wrote a simple AJAX external script for my homepage that tries to load some static markup from a seperate html file and insert it into my homepage when i hover over a link... $(function() { $('a#contact_link').hover(function() { alert('test1'); $('<div id="contact_container">')...

How to use nify javascript to make round corner box? Im using but not working

How to make round corners with Nifty technique. I included niftycube.js and then called the function Nifty("div.firstblock");. But its not working. Whether i have to include any other JavaScript or CSS??. Help ...

Determining image file size + dimensions via Javascript?

(EDITED changes in italics) Goal: As part of a web app, once images have been downloaded and rendered on a web page, I need to determine an image's file size (kb) and resolution within the browser context (so I could, for example, display that info on the page. This needs to be done client-side, obviously. Must be able to be solved x-bro...

Does anyone know of issues with jQuery selector in IE with html select boxes?

I've got the following jQuery code for getting the first character of the string value of the selected option of an html select box. var mode = $("#mode :selected").text()[0]; "mode" is the id of the html select element I want. This is not working in IE at the moment - does anyone know why that might be? EDIT: Sorry everyone, it wa...

JavaScript OS Detection - several Windows XP versions?

I am trying to detect three operating systems - Windows XP, Windows Vista, Linux. I use the navigator.oscpu which alerts the following OS/values - Windows XP SP3 - Windows NT 5.1 Windows Vista - Windows NT 6.0 Ubuntu 9.04 - Linux i686 I am doubtful about the number 5.1 shown for XP. Will it show 5.1 for ALL configurations or XP - ...

DIV innerHTML redraw causes items that were hovered to go back to normal

I have a DIV container that draws a list of bars (al container 'onmousemove' and 'onmouseout' events). When an item is hovered, it changes the images of the item, and back again when the mouse is moved away. Now, I have a looped AJAX request that gets the new information for this DIV container and re-draws the innerHTML every 3 seconds...

google map dynamically put mark on map for my listbox (city, town) selection

Hi friends, I'm working on a property portal. I need to do implementation with gMap :/ I have a dynamic listbox and I need google map to dynamically put mark on map for my city and town selection... appreciate helps!! thanks ...

Access Silverlight's createObject via Javascript's new operator?

feel free to skip down to the question below I'm trying to create a bridge so a huge javascript application can be replaced by a new Silverlight-based rewrite as smoothly as possible. In the legacy application, there is this JS class: function LatLng(lat, lng, url) { /* snip... */ } And it is being used a lot throughout my customer'...

Best way to organise Javascript code

How do you guys organise your javascript code? I know that it is good practice to store the code in an external .js file and this is fine for code that is run in multiple pages but how do you organise if you have, say 20 pages, and only 1 of them uses a particular function. Do you create a new external file for that 1 page or create th...