javascript

Slide Down and Edit Within HTML table

Hello, Basically I have a html table with a bunch of data from a database (MySQL). I would like to be able to press on a link and have the a given table row slide down to expand into the editing zone. I would use Ajax to populate that editing space with the detail data from the database. So this would be my table: <table> ...

Do Browsers cause Interrupts to their JS when receiving a response?

Assume, for whatever reason, that we have three inline scripts on a page. Each of these scripts are functionally the same, and all three will create a script tag, with the source set to a server-side script (each with slightly different parameters) which returns JS to execute. Assume this JS contains a global variable containing importan...

Detect Browser Refresh in Javascript

I am curious if there is a way to detect the browser refresh event in javascript specifically. We are using the jQuery.address plugin to provide forward and back button functionality to AJAX functions. The problem I am facing is that this plugin does not seem to detect if the user has refreshed the page. This code is executed each time ...

using eval.call() in firefox XPCOM component

Hi, I'm making an extension that on load of every page creates an instance of my xpcom component specifically for that page. I do that like this: var appcontent = document.getElementById("appcontent"); // browser if(appcontent) { appcontent.addEventListener("load", onPageLoad, true); } var onPageLoad = function(aEvent) { var do...

Why doesn't the defer attribute work on script tags that don't source an external js file in Firefox?

Why doesn't the defer attribute work on script tags that don't source an external js file in Firefox? lets say an ancient cms only allows me to add javascript to templated pages via in-page [script]...my code...[/script] tags and strips any html tags entered into the content area field, thus preventing me from embedding scripts just abo...

How is a NullLiteral represented in tree form?

According to the ECMAScript specification in section 7.8.1 a NullLiteral is defined as follows: NullLiteral :: null What I am trying to understand is how this is represented in tree form when a NullLiteral is included in the following productions found in sections 7.6.1 and 7.8. ReservedWord :: Keyword FutureReserved...

Set Defaults in a Webpage--> Conceptual Problem

I have both php and javascript in my code. There are links which change javascript variables which are then passed to php via $get. To change the values I'm pretty sure I would have to refresh the page. Where could I put default values such that they load the first time the page does but not on every successive refresh as they would over...

How do I show/hide multiple divs (not possible for each to have a unique ID) in a Rails app?

I need to create a 'Reply' button that shows a form for any item in a feed. In other words, it can't be showing/hiding something with a unique div id, because it has to work for any of a (potentially) infinite number of items. If I use code like this: <% @questions.each do |question| %> <%= question.content %> <a href="" onclick="s...

Running Less.js on C#/Javascript.net/V8

I'm trying to run less.js in a C# application. I tried running the default distro using JavaScript.net but I'm getting window is undefined error. I think that is caused due to this not being run in a browser but on a JS engine. Is there any workaround / any pointers to resources that can help? ...

Capable opensource embeddable html email control

Does an opensource web control exist that can read raw mime-encoded email (stored in a mysql db) and reliably render it to the browser? Something along the lines of fckeditor but email focussed? The control only needs to be able to render the email (and preferably expose APIs for working with the email header, attachments and contents)....

Best way to code an HTML/CSS/JS tab navigation system (no images)

Hi, I'm coding a tab system for my website that must be entirely CSS/HTML/JS (without using any images). Problem is, I keep hacking the code until when I'm finished its just a mess. I don't know whether to use positioning, or float the tabs or what. Basically one of the big problems is that after I take away the bottom-border CSS of t...

Trouble decoding tiled base64 data with javascript

I'm using tiled to create a tile map. (Tiled is a tile map editor with support for orthogonal and isometric maps) It saves the map in an XML file. It can use certain encoding structures: regular base64 base64 + gzip base64 + zlib regular csv Now, I've completely given up on gzip (my server gzips traffic it anyway, so no loss there) ...

js replace global doesn't like +?

So I've been playing around with the replace function (method?) in js. $get('msgBar').replace(/+/g,' '); Let's say the content of $get('msgBar') is "Welcome+back+now". replace('+',' ') would only replace the first +, and not the second. replace(/+/g,' ') crashes replace(/"+"/g,' ') and replace(/\+/g,' ') are both the same as the fi...

PageMethods and page controls reference

I'm using pagemethods to call a method from javascript, is there a way to access the page's controls from the method in codebehind (marked as static)? The problem is that the pagemethod nedds to load a business entity and load it to the page, and the structure is complex. Thanks in advance for any help. ...

XML-RPC Javascript Unsupported method ('OPTIONS')

We've got an XML-RPC server (implemented in python), and I'm trying to write a simple javascript app to send calls to it. Whatever library I make I seem to always get the error: Unsupported method ('OPTIONS') It's fair to say I don't understand the underlying protocols for XML-RPC and HTTP as well as I should. But what I do know is th...

Any simple way to clean all Markers, Polylines and other Overlays on Google Maps v3 API?

I want to get a new map not using refush the webpage. thanks and has easy way to get all Overlays on the map? ...

document.createElement("script") synchronously

Is it possible to call in a .js file synchronously and then use it immediately afterward? <script type="text/javascript"> var head = document.getElementsByTagName('head').item(0); var script = document.createElement('script'); script.setAttribute('type', 'text/javascript'); script.setAttribute('src', 'http://mysite/my.js...

jQuery toggle question

Hello all, I have a question concerning using the toggle function. I have a template that is being populated at the end of an AJAX call with data returned from a web service. What I'm trying to accomplish is load the onClick function so that a hidden textbox will be shown and toggled to be hidden on the next click. What's happening is...

How can I fire a Button Click event when Enter Key is pressed based on what textbox has focus?

I have a form with several submit buttons. I would like the button's click events to fire when enter is pressed based on which textboxes currently have focus. I am able to specify one button using the code below by adding the onkeydown event to the body of the page and checking for Enter's keyCode <body onkeydown="if(event.keyCode==13){...

Adding form elements to a form powered by Zend_Form

I have a huge and complex form, and I have build it using Zend_Form. There are multiple places in the form where the user can add elements on click. Currently, if the user submits the form, and the validation fails - the elements added by the user are not retained - as they were not a part of the form. Is there a natural way to add them ...