javascript

calling a javascript function from activex

Hi all, I am building a small activex control. I understood that activex cannot call a javascript funtion directly, but needs to work through events. Therefore I've created an event, copied from a code sample from codeproject. The event seems to work only on certain circumstances: It works when a call is made to a javascript function w...

Jquery Animate Background Image Transition

I have a navigation bar that when hovering over an item, the background image is changed, that works fine. However, I would like this image to slide in from the top, and slide back up when you stop hovering. I've been trying to do this with JQuery, using css bacgroundImage and sliding or toggling, but none of that seems to work. How can...

JavaScript tabs - too many if functions that control it

Hello, I have several tabs that my site changes between using Javascript. When ever a tab is clicked I need to know which one it was and which one I am currently on. I have done this through the use of if functions(lots!). I now want to add a new tab and I have to expand all my if functions etc. Is there a different implementation I c...

Tabbed Browsing Causing Javascript Inconsistencies?

In a tabbed browser (FF 3.5 in for me), I often open links in new tabs with CTRL-click or middle-click. When the link contains a Javascript function, either: A blank new tab opens with javascript:window.print() or what-have-you in the address bar. The function executes successfully and a blank new tab opens. Thing is, this doesn't s...

lvalue return expressions in Spidermonkey Javascript

Here's an interesting question that could provide useful input into the Spidermonkey flavor of Javascript (used in Firefox & other programs)... The original was in a post on mozilla.dev.tech.js-engine but i'll quote here as well: Newsgroups: mozilla.dev.tech.js-engine From: Brendan Eich <[email protected]> Date: Fri, 7 Aug 2009 12...

How does the Javascript print function work? Can I create a document using javascript and print it off?

I know you can use window.print() to print the current page... but what I want to know is can I build a document using javascript in order to populate it with data and print it off? Just like you can have html/xml as a javascript object, can you do something similar to this: var name = "Matt"; var htmlDocumentToPrint = "<html><body><di...

Post Method Not giving Alerts like planned?

<form action="" method="post"> <div align="center"><legend>Add a Code</legend> <label for="code"></label> <input type="text" name="code" id="code" maxlength="10" /> <input type='button' onclick= "isAlphanumeric(document.getElementById('code'),'Your Submission Contained Invalid Characters'); isBadPhrase(docum...

Which takes less memory: a Javascript array or Javascript object?

If I have a Javascript list which will have only numeric keys, which takes less memory? var array = []; array[0] = 'hello'; array[5] = 'world'; array[50] = 'foobar'; var obj = {}; obj[0] = 'hello'; obj[5] = 'world'; obj[50] = 'foobar'; I don't know a ton about Javascript engine internals, so... The reason I ask is because that array...

Managing named windows with javascript

Is there any way to access opened windows (tabs) via javascript that have a name set by the window.name propriety but were not created by the window.open() method. The windows contain documents from the same domain, so no security related problem should rise. If no cross-browser solution exist I would also be interested in browser-depend...

At what volume of data does a JSON data structure become too slow?

I'm using MIT's Simile to display thumbnails and links with faceted filtering. I works great, but large data sets (greater than 500 elements) start to slow significantly. My user base will tolerate seconds, but not 10's of seconds, and certainly not minutes while the page renders. Is it the volume of data in the JSON structure? Is it...

print a modal window not the rest of the page

i have seen some answers to this but i think i am actually having a css issue. here is a sample fragment of my html < id=container> children children if i pop open the modal there is a print button. when i click it i use jQuery to apply a .noprint to #container and .print to #modal. but the .print to modal is disregarded. no matter what...

a website that will compare prices of a yamaha baby grand piano

i would like to design a website that will crawl 100 other websites and post the current prices in ascending order of the same model yamaha baby grand piano. the prices on these sites will appear in simple HTML. the question is will i have to modify my algorithm for every single site, or is there some kind of artificially intelligent too...

Javascript: "Cancelling" a dynamic script tag?

I use dynamic script tags to request javascript from external domains. Sometimes the request takes too long; is it possible to stop the request or timeout if the requests takes too long? I do not want to use xmlhttprequest because I'd like to avoid having to use a server side proxy. Thanks! ...

Javascript Regex: Bolding needles in a haystack

Related (but not the same): Javascript Regex: How to bold specific words with regex? Given a needle and a haystack... I want to put bold tags around the needle. So what regex expression would I use with replace()? I want SPACE to be the delimeter and I want the search to be case insensitive and I want special characters (such as @!...

Javascript objects performance

I am unsure how javascript stores objects, and references them. So, I don't know if my plan will cause bad performance. Any insight would be appreciated. I have many divs on a website, and each has a unique id. I have an object constructor: function box_object(box_id){ this.the_box = document.getElementById(box_id); this.rela...

Alerts not working

Possible Duplicate: Post Method Not giving Alerts like planned? Javascript: function isAlphanumeric(elem, helperMsg){ var alphaExp = /^[0-9a-zA-Z]+$/; if(elem.value.match(alphaExp)){ return true; } else { alert(helperMsg); elem.focus(); return false; } } function isGoodPhras...

Manipulating an element using jquery not working

I have a regular div, like so: <div id="registry_ViewPanel"> <div id="registry_Header">Register</div> <div id="registry_Content"> //Registry fields here </div> </div> with css: #registry_ViewPanel { width:400px; height:400px; border:1px solid; background-color:#fff; display:none; position:fi...

Sending the current date via ajax to my .net handler, how to pass a safe date?

Hi, I need to pass a date, that will be generated via javascript to a asp.net http handler that is services in ajax requests. On the .net side, I will take the date passed in a cast it to DateTime. The date has to have: yyyy, mm, dd, and minutes and seconds. How can I format a date in javascript to this format? Using jquery ...

IDE Duel -- Zend Studio 7 or Dreamweaver CS4

I'm developing PHP apps that leverage several frameworks (though not the Zend Framework yet...) and I make good use of Javascript (mostly jQuery). All mark-up is XHTML, of course, with CSS, etc. I'm looking to move beyond the beautiful simplicity of Notepad++. I'm using Windows Vista. I'm trying to decide between Zend Studio 7 or Dre...

Changing Scrollbar Position

Is it possible to change the scrollbar position when the user reaches a certain point scrolling down a web page? For example once you reached half way down down the page the scrollbar would move automatically back to the top. Thanks. ...