javascript

EXT Js question

I currently have two panels within another large panel. The left panel is for navigation and the right is for content. I'm trying to modify the content panel background color so I have made an event that triggers on expandnode, and this is where I am stuck. My right panel ID is #panneau-affichage and I'm trying to modify the background-...

Javascript Universal way to know added new element

AddEventHandler in Javascript is for handling the events (like onclick) universally (i.e. on any element). Is there a way to fire an event (don't know which kind) when a new element (i.e input, div, select, etc.) is being added to the page (through Ajax, jQuery, etc.)? I've looked into the DOM documentation on dev mozilla but couldn't...

Converting JSON string to object with selective evaluation

I have a string: "{0:16970861903381446063,length:1}" I tried converting it to an object using the eval method, but it also evaluates the string and hence rounds the numerical value, returning: {0:16970861903381447000,length:1} I tried passing the number as a string before calling eval on it, using 16970861903381446063 + '' as the ...

how to render a user the local-time using a UTC Time (asp.net & ajax)

Hi, I've an issue while my data persisted as utc date-time and I want my users see the right time (thier) local time. I can do this using javascript that sends the local time from the client machine to server, but this will cause me the first time the page will be seen it will be written using the UTC-Time. do you have more ways? than...

Issue with selectors & .html() in jquery?

The function associated with the selector stops working when I replace it's contents using .html(). Since I cannot post my original code I've created an example to show what I mean... Jquery: $(document).ready(function(){ $("#pg_display span").click(function(){ var pageno = $(this).attr("id"); alert(pageno); var data="<span id='page...

how to uncheck checkboxes with javascript

Hi everyone, I have the following code. I need to see how many checkboxes have been checked in my form and if there are more than four display error and uncheck the last check box,everything is working but how can I uncheck the last check box, thanks function SetHiddenFieldValue() { var checks = document.getElementById('top...

Selecting value of <select> tag in javascript. problem

Hello. I have an external Javascript file and i am trying to alert the value of select tag. My <select> code looks like this: <select id="vote"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> <input typ...

What's the correct way to call MooTools JS code from within Joomla?

I wrote some MooTools code that reads from YouTube's API in JSON and I want to execute it from within a custom component. I've been reading about the js.php file, but I'm unclear on the best approach. I was just going to output js in my component directly, and then i realized that the MooTools library isn't being loaded unless a compone...

Problem: Alert value of dynamically created select tags.

Hello. I have an external Javascript file and i am trying to alert the value of select tags which are being generated dynamically through php. the problem is, that it selectes the value of only the first select tag. What should i do, so that the javascript is able to independently identify each select tags value. My <select> code l...

Parse custom XML schema with jQuery

I am getting custom schema data back from an AJAX call and I need to parse it using jQuery. Any idea how to do this? Here's the XML: <xsd:get_customer_summary_response xmlns:xsd="http://com/acmeco/ovm/cas/xsd"&gt; <xsd:customer_details> <typ:phone_number xmlns:typ="http://com/acmeco/ovm/cas/types"&gt;1.555.5553002&lt;/typ:phone_n...

Parse a JavaScript string best practice

I have this var checkBox = e.target; var tableRow = checkBox.parentNode.parentNode; var key = tableRow.attributes["key"]; var aKey = key.nodeValue; at this point aKey = "[123]" what the best way to return 123 as an int in javascript? note that aKey could just as likely be "[5555555555555555555]" so I can't just grab c...

Javascript for a form on the server-side?

*The question emerges from the discussion with Christoph in my last question 'HTML: target=”blank” for a drop-down list' and the alternative method by Andrew. Problem: to run code server-side because some users lack Javascript support. The situation is a form like here. Some suggestions: Christoph's recommendation: <form action="path...

Using JQuery Tabs as Main Navigation

A JQuery UI Tab that inherits from a JQuery Theme and redirects (HTTP GET) to a new page is the goal. I'm 90% there using the following code, but the compromise has been to put the target URL in the anchor TITLE (the Tab widget expects the HREF to be a local page selector). This works, but for SEO purposes I'd like the HREFs to be actu...

How to recognize the JavaScript method(function)

I am writing a Plug-In for VS2008 and I would like to recognize the JavaScript method(function). I have a file - sample.js:` function test0() { var i = 0; { var j = 0; } var array = { 1: 2, dd: 10, aaa: 3 }; return array; } function test1() { ...

Prototype's Ajax.Request and Internet Explorer 8

The following code is supposed to perform an AJAX request after the page loads, and then display the response of that AJAX call in a popup. This works in Firefox, but I have no idea why it does not work in IE8. <html> <head> <script type="text/javascript" src="js/prototype.js"></script> <script type="text/javascript"> // Do this stu...

.XHTML Extension & Syntax Highlighter

i tried to use Syntax Highlighter in a XHTML/CSS Template. i noticed if i use the .xhtml extension the Syntax Highlighter fails. if i rename the extension to .html it works. so the question is: - Syntax Highlighter does not work with XHTML? - whats the difference between .xhtml vs .htm/html? if i still have the same code? xml declarat...

How to keep some input text removed by jquery when going back with browser?

Hi! I have some bug with the following page: http://jsbin.com/agedu/ Source code with some comments: http://jsbin.com/agedu/edit The problem is that when typing something and doing the query to display search results, if I go back to the search page in my browser (Firefox 3.5 but it's the same thing with IE8) there isn't my search term...

How do you make ajax work from different directories?

First, let me show you the folder structure: public_html[] |_ project_folder[] |_another_folder[] |_xml_folder[] |_xmlfile.xml |_ js_folder[] |_javascriptfile.js |_ file.html |_ file2.html I have some file.html ...

How can I use PHP and JavaScript to make an image clickable, and increment a counter stored as a flat file?

Im trying to find a php/js script that will let me take an image, and when clicked, increase the number in a flat file, and save that file. I know how to include the file to get the vote total. Im going insane trying to find this to plug and play into my website. Id love to have ip logging, and a cool fade in/out refresh update thing. ...

jquery toggling a div - how to do this with multiple ids?

I am new to Jquery. My setup is as follows: I have a series of divs that need to be able to be toggled (display hidden and shown). Each div has an action that can be performed so a unique ID will be necessary to know from which div the event came from. To toggle the div I have a button for each div (which is not located within the di...