javascript

iPhone - Phonegap UI Controls - Tab Bar

Hi there Just started with Sencha today and found it a bit overwhelming. Was able to get a nice custom tabbar working, and top nav panel, however am stuck from where to go. Decided it might be a lot easier to just use JQTouch and a Phonegap TabBar instead. I found: http://phonegap.pbworks.com/iPhone%3A-UIControls-(TabBar) I'm on the...

rails jQuery Accordion

How do you set up jQuery to work with rails. I specifically want to use the accordion feature. I have used this before with PHP but i cannot work out where everything needs to go in a rails application. I have imported jQuery into the javascript folder and included it in the application. My HTML is laid out correctly, but i don't under...

How to subscribe a method to fire onchange and on a custom event?

I have a method setup to fire onChange with the following code: var product = $('#selProduct:visible'); var note=$('#bbdata'); product.selectProduct({ target: note, url: 'product.php', data: { ajax: true } }).trigger('change'); // TO DO: to fire also on visibility change Then I have a method where I make a div visible. ...

Javascript onload in HTML

hi, everyone, I want to ask a question about the javascript "onload". I am writing the JSP page and I use the <%@ include file ="body.jsp". and I use the following statement in the body.jsp. <table onload="function()"> to load a javascript function, but it doesn't have any action of the page. Is the "onload" can only be used in the ...

Can't set value on hidden input element

Hi there. I have a problem setting value of an hidden input element. I've tried using jQuery and $("#SomeHiddenElement").val(sSomeValue) function, and plain JS document.getElementById("SomeHiddenElement").value = sSomeValue; but nothing works... When I set the element to text type it works just fine... The problem persists both in FF ...

Accessing C# method in a JavaScript function.

How can i execute a C# method in a java script function? Is it possible? ...

New Google Analytics code into external file

New Google Analytics code looks like one below: <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-0000000-00']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protoc...

Toggle class of Table Row

I'm trying to write a javascript that will toggle the class of a table row on the onClick event so that I can use css to change the look and functionality of it, however I'm not quite sure how to accomplish this. The goal is to have a table in which users can select a row and have it highlight, and should they select another row the pre...

javascript elements not working

I was not able to get part of this javascript code working for unknown reason and display as undefined. How do I merge vote[1] into the formObj which is document.forms[0] Any other alternate solution? var elements2 = formObj.elements['vote[' + pollId + ']'; ...

$.ajax() call, only on updation

I am reading a xml using $.ajax() request. $.ajax({ type: "GET", async: false, url: "../../../ErrorMessages.xml", dataType: "xml", success: function (xml) { $(xml).find("*[Name='" + Field + "']").each(function () { message = $(this).find(Rule).text(); }); } }); I want to make the call on...

mouseover parent = find() child id name

when mouseover #divlayer, find() id of child span <div id="divlayer"> <p>title</p> <span id="apple">apple</span> <span id="orange">orange</span> <span id="kiwi">kiwi</span> </div> $('span').hide(); $('#divlayer').mouseover(function(){ $('span').show(); $(this).find(???).attr('id'...

creating a selector that works on visible items, also if they were initially loaded as display:none

I have a method defined this way: var product = $('#selProduct:visible'); var note=$('#bbdata'); product.selectProduct({ target: note, url: 'product.php', data: { ajax: true } }).trigger('change'); $.fn.selectProduct= function (options) { var defaults = { key: "id", value: "label" }; var se...

How to remove above and below spaces in Order list

<html> <body> sdadfasdf a <ol> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol> asfdasdfasdfadf </body> </html> Output is sdadfasdf a Coffee Tea Milk asfdasdfasdfadf How to remove above and below spaces in Order list ...

Raphael generated SVG, path render issue.

I was asked to develop a "Flashy" graph for a cliënt. I grasped the chance to try raphaeljs for this project. All worked out fine but now the mousover labels don't get rendered in Chrome. Only the part where there is text on top of the path it gets rendered. The development version is placed on http://85.145.85.127/projects/ilsf-graph/ ...

Tradional Ajax or Jquery Ajax, which one is better?

Hi All This is just a general question. Which is better, traditional ajax or the jquery ajax? Because when I use the jquery ajax, it seems to do funky weird stuffs in IE. And it supposed to be a cross-browser library... So I'm a bit confused as to which one to use. Again I'm asking this because of the serial-killer IE... The funky weir...

Is it better to bind/unbind events or to use a conditional (jQuery)

Ok, this is a performance question I guess. I have a slider with two navigation links (next and previous) and when the slider gets to the end of the row I am currently unbinding the next button, then binding again when it goes in the other direction. I am performing the same operation for the next button, but reversed. the code for the...

Get all form elements value to be attached for ajax call

I have an object that is inside of a form. His value is assigned to an ajax call like this var $$ = $(this); if (typeof settings.data == 'string') { data = settings.data + '&' + this.name + '=' + $$.val(); } else if (typeof settings.data == 'object') { data = settings.data; data[this.name] = $$.val(); } I want to get the par...

How to get a NON-standard attribute in IE8 through javascript?

I have an HTML page that has this doctype: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt; However, the HTML contains this tag: <applet src="blahblah"></applet> (EDIT: actually the HTML doesn't contain the applet. The applet is created dynamically by other javascript code). Yes, I know...

Jquery and retrieving object via .find()

Hello, Via ajax method, I need to fetch an html which is a real mess, half of the elemnts are opened but not closed. Now I need to find elements which contains time string as in such format: "19:00-20:00" which means it should have something such as "HH:MM-HH:MM". How can I fetch these rows that contains such time-time elements ? an ...

Alert when div height changes

Hey everyone, I've been searching all day for this but i can't figure it out myself.. I have a shopping cart that you can add items to. The shoppin cart is in a drop down so you have to click it in order to view it. Therefore, everytime you add an item to the cart i want to display "+1", "+2" and so on, somewhere and when u click on th...