javascript

Resize image map on window resize

Hello, I'm trying to resize an image map on window resize event. The closest I've gotten is to use a mouseclick event, but it needs to be window resize for what I'm doing. I'm using Firefox 3.5.5 I'm using jquery somewhat. Here's my example - the area button I want to resize on window resize is in the top left (click on it to resize ma...

JavaScript PopUp - Link target from Popup = other Window of browser

Hello, i open a html page with a js popup <script language="javascript" type="text/javascript"> <!-- function popitup(url) { newwindow=window.open(url,'foobar','height=575,width=950'); if (window.focus) {newwindow.focus()} return false; } // --> </script> <a href="index.php" onclick="return popitup('foobar.html')">Link to...

JQuery selector builder?

I was wondering if such a tool exists in a browser. You select any item on the page like a <p> tag nested in several div's and the tool creates a JQuery selector for it which I can copy and use in my Javascript function. ...

JavaScript Help

I am completely stuck on how to finish this problem... the question goes... Write a function quality Points that inputs a student’s average and returns 4 if the stu¬dent's average is 90–100, 3 if the average is 80–89, 2 if the average is 70–79, 1 if the average is 60–69 and 0 if the average is lower than 60. Incorporate the function int...

Why doesn't my <script> tag work from php file? (jQuery involved here too)

<!-- According to Meta-SO, editing is a way to politely bump, so I am trying this one more time to see if anyone has any more info. Thanks --> UPDATE: Still haven't solved this issue: Hello again: I have worked away at this issue, and still no luck. I am going to try and clarify what I am doing, and maybe that will bring something to...

javascript undefined error, but alert toSource shows the object exists

I grabbed a bit of code to do some paging with jQuery, via Luca Matteis here http://stackoverflow.com/questions/516754/paging-through-records-using-jquery I've made some edits to the paging script so that I can use the same code to provide paging of different content in different locations on the same site. For the most part, I think ...

Accessing Linux diagnostic information from JavaScript

Is there a way can I access machine diagnostic information within the Linux OS in realtime? Such diagnostic info as CPU utilization, memory utilization, etc using JavaScript to display on a web page? If there is no direct access from JavaScript, is there any other method where JS code can call functions in shared libraries (dll, etc.)?...

A tidy solution for using static JSON data

I'm developing a simple JavaScript (jQuery) slide show. I wanted to use JSON to store some some static parameters about the content of each slide. Since I like to keep my data separate from my code, is there anyway to have JavaScript evaluate a .json file? AJAX seems a bit overkill - it just needs to evaluate it at run-time, nothing ...

Anything similar to E4X to find in/traverse JSON?

When for example returning JSON from a Google Spreadsheet, the object returned contains an array of entry objects (corresponding to rows in the spreadsheet). An entry can have a name like so: jsonObject.feed.entries[15].name = "xyz"; Can I easily return an entry with the name of "xyz" using shorhand notation (E4X) of some sort? thanks...

How to access the value of an object from inside a method of the same object in Javascript?

Hi, I'm trying to add a toBool() "method" inside the Object object using prototype... something like this: Object.prototype.toBool = function () { switch(this.toLowerCase()) { case "true": case "yes": case "1": return true; case "false": case "no": case "0": case null: return false; default: return Boolean(string); } } var int...

What is the JavaScript >>> operator and how do you use it?

I was looking at code from Mozilla that add a filter method to Array and it had a line of code that confused me. var len = this.length >>> 0; I have never seen >>> used in JavaScript before. What is it and what does it do? ...

Are there any good reasons NOT to use jQuery instead of plain old JavaScript?

I recently discovered jQuery, and I can immediately see how useful and elegant it is. I'm curious, though - are there any reasons NOT to use it (and just use plain old JavaScript instead)? If there aren't any reasons, should it not be integrated fully into the JavaScript language? ...

GWT server-side interaction with database

I am building a project in GWT that pulls an rss feed, executes regular expressions on the feed (in javascript using JSNI), and then stores that resulting data on a database where the users can access it. As of right now, I have been writing all the code in the client-side .java file hoping that I could simply transfer it to the server-...

Clicking checkbox to expand div, doesn't work in IE7

The following code works fine in FF, but doesn't in IE7 - when clicking the checkboxes in IE the divs doesn't toggle. How do I troubleshoot these kind of issues - does anyone have an idea on how to go about this? // hide divs $('.product-optional-toggle1').css({ display: 'none'}); $('.product-optional-toggle2').css({ display: 'none'})...

Text replacing with JS

I need to replace text entered in textarea with other characters, that I will call. For example, I need to replace the text, that I will enter to the textarea by clicking some button calls "change text" using JavaScript and it will change, for example, character "a" to "1", "b" to "2", "c" to "3" etc. ...

Can I flush the event stack within Firefox using Javascript?

I have a hierarchy of tags within my HTML which all contain onclick event handlers. The onclick is pushed onto the event stack from the leaf back through the root of the hierarchy. I only want to respond to the leaf onclick event. Can I flush the event stack rather than using a flag? For instance... <ul> <li onclick="nada(...

Why does Internet Explorer prevent me from accessing the parent window's JavaScript?

I have IFrame with a button in it, and it's onclick is: new window.parent.UI.Image('xyz').addToCart(); In Firefox, I don't have any problems with this code. In IE, however, I get a "permission denied" error. Is there a different way I should be accessing the JavaScript in the parent window? ...

JavaScript Classes and Variable Scope

I'm relatively new to JS and I'm having issues properly emulating OOP principles. I guess I have two questions. Question the first is regarding the many ways to declare variables. Say I have a class: function clazz(a) { this.b = 2; var c = 3; this.prototype.d = 4; // or clazz.prototype.d = 4? } var myClazz = new clazz(1)...

hide checkbox border in html/javscript/css

is there a way to hide the square border of a checkbox in html? ...

Make a JavaScript Auto generator for visitors to my website

Hi, I have a website that stores quotes and users can add some quotes to their favorite list. I want to be able to let those users generate a JavaScript snippet to put in their blog or website and this JavaScript will display their favorite quotes one by one every set period of time say 60 seconds. I have been using Ruby on Rails which...