javascript

How to do bitwise AND in javascript on variables that are longer than 32 bit?

I have 2 numbers in javascript that I want to bit and. They both are 33bit long in C#: ((4294967296 & 4294967296 )==0) is false but in javascript: ((4294967296 & 4294967296 )==0) is true 4294967296 is ((long)1) << 32 As I understand it, it is due to the fact that javascript converts values to int32 when performing bit wise ope...

How to listen for a variable change in Javascript?

I've been messing around with using Node.js and CouchDB. What I want to be able to do is make a db call within an object. Here is the scenario that I am looking at right now: var foo = new function(){ this.bar = null; var bar; calltoDb( ... , function(){ // what i want to do: // this.bar = dbResponse.bar; ...

javascript XMLHttpRequest requestXML is null

Hi there, I'm trying to grab an xml document from a url and then parse it. I am able to open it fine on a browser, but it doesnt seem to work through my javascript. Can anyone help me? function downloadUrl(url, callback) { var request = window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : new ...

What's the best and easiest way to Populate a dropdown based on another dropdown.

Hi all, Very simply, I have one dropdown menu dynamically populated with data: SQL Code $querycourse = "SELECT course, COUNT(course) AS count FROM acme WHERE course IS NOT NULL GROUP BY course "; $procc = mysqli_prepare($link, $querycourse); $queryc = mysqli_query($link, $querycourse) or die(mysqli_error($link)); PHP Code echo "<s...

Matching multiple input values in regex

Hi I have the following input values and I was hoping someone could kindly tell me the best way to match all of the "values" (217, 218, 219) -- The html is escaped and that's what I need to match. <input type=\"hidden\" name=\"id\" value=\"217\"\/> <input type=\"hidden\" name=\"id\" value=\"218\"\/> <input type=\"hidden\" name=\"id\"...

Javascript function variable preset

Hello, I have a function that I want to pass an argument to, however I want it to default to 0. Is it possible todo it similarly to PHP, like: function byMonth(export=0) { Many thanks ...

any suggestions for getting the data for the web portal?

I have launched a new Movie Based web portal, I have completed the programming part and Made the site dynamic. My Question, How can i get the data about the Movies from different languages For example: www.imdb.com has a huge database collection. Is there any web crwaling methodology where we can get it? Or dirty method of Complete Data ...

Handle elements after innerHTML or html(). Javascript.

I'm adding new element through html() function of jQuery. Then I want to handel it. Is it possible to do that in way you see here? $("#renamePlaylist").click(function(){ var aa = '<input type="text" name="plst_name" value="'+$("#playlist_header").find("span").text()+'" size="'+Math.round($("#playlist_header").find("span").text()....

Javascript adding two numbers incorrectly

Global.alert("base: " + base + ", upfront: " + upfront + ", both: " + (base + upfront)); This code above outputs this: base: 15000, upfront: 36, both: 1500036 Why is it joining the two numbers instead of adding them up? I eventually want to set the value of another field to this amount using this: mainPanel.feesPanel.initialLoanAm...

Stopping Javascript execution on loaded page?

Hi All,   There is some problem code in a website I don't have source access to. Upon loading the page, something goes wrong (in my version of Win and FF at least) such that ajax calls are made repeatedly instead of just once. This quickly locks me out of firebug and pretty much everything else so that all I can do is close the tab.   ...

debug JS code which triggers an alert()

Dear all, I have a system which is built using the ext-js library. Part of the system lists orders that are flowing through an online store. When a row is clicked, additional order details are shown. A few days back, a message saying "FIXME: created panelID..." began to appear as soon as a row is clicked. After that, normal functioning ...

Flexible CSS boxes with texts.

Hi, I'm trying to accomplish something thats kinda like in engadget.com (look below "TopStories") Except that those boxes are with images and fixed width. The top-left is with the largest width, top-right is smaller. Lower boxes are of equally fixed width. They are Static! which is just not what I want. I wana create a a newspaper eff...

How to compare height of nested divs?

I got 2 divs, one inside another. <div id="ads_content" class="ads_contents"> <div id="ads_text" class="ads_text"> ... text contents ... </div> </div> ads_content div has max-height of 230px, and it has overflow: hidden. So there will be shown a definite amount lines of text from ads_text div. I need to compare their ...

Caching a reference to an element in an iframe with jquery

I am using a jquery dialog that uses an iframe to let the user know there session is about to expire. I would like to update this dialog every second with a countdown, thus I would like to cache a reference to the countdown element so we don't have to query the DOM for it each second. I have tried to do this many different ways and I ca...

Dynamically specifing contents to be highlighted, SyntaxHighlighter

Hi! I need to load the codes that will be highlighted by SyntaxHighlighter. I have this $("#syntax").change(function () { var code = $('#syntax').val(); code = "<script type='syntaxhighlighter' class='brush: js'><![CDATA[" + code; code += ']]>' + "</" + "script>"; $('#preview').h...

Prevent XSS attacks site-wide

I'm new to ColdFusion, so I'm not sure if there's an easy way to do this. I've been assigned to fix XSS vulnerabilities site-wide on this CF site. Unfortunately, there are tons of pages that are taking user input, and it would be near impossible to go in and modify them all. Is there a way (in CF or JS) to easily prevent XSS attacks acr...

Client side iCalendar Event Creator

Hi, I need to add some functionality to a web application that allows a user to create an event which will be added to a calendar. I would like to give the user as much flexibility as possible when created events (single events, recurring events, etc) ... bascially as much of the flexibility that iCalendar allows for its Events as possi...

Jquery timeout code not re-running after first time user extends session

I wrote a Jquery function that blacks out the screen after a certain amount of inactivity, creates a pop-up that allows the user to click a button to stay logged in, and logs them out (closing the application window) if they do not respond in time. The environment is ASP.NET (VB). We don't technically use master pages, but we do have a ...

jQTouch Dynamic Web app???

I'm working on a dynamically changing web app. I'm using javascript and jQuery to populate DIV's with <li>'s and <a>'s. For example, I start with one menu dynamically built with javascript. From that menu, depending on item selected, another javascript function gets called to dynamically populate the corresponding DIV. The problem comi...

Make IE 8's javascript console give more info than "{...}" for objects

I'm trying to debug an issue that only seems to occur in IE 7 and 8, and the debugger's console is being utterly useless. Any time I type in an expression that results in an object it just prints "{...}" to the console. I need to inspect the returned object, but it gives me no easy way to do so. Is there any way to get this to behave ...