javascript

jQuery element click

I have an element, an anchor, how can I "click it" with jQuery, I mean like a normal user click, because I'm receiving a click on an element..but also I need to fire more events... Ok here is my example <a class="som" href="http://domain.com/ssl-signup.php" target="_blank">Test Link</a> $(document).ready(function(){ $('.som').click(...

need a javascript or jquery library to convert xpath to selectable CSS3 format in jquery

how can i convert xpath like /html/body/div[3]/ul/li[1]/a[5] html > body > div[3] > ul > li[1] > a[5] i believe, index is not supported with CSS3 selectors....so how to deal with this ? ...

Why doesn't this JavaScript function remove square brackets one by one?

var asdf = "a[3] > b[5] > c[1]" function removebracket(){ var newstring = asdf.replace(/\/[^\/]*$/, '') alert(newstring); } <a href="#" onClick="javascript:removebracket();"> remove square brackets one by one </a> ...

What kind of a pattern/object is this in Javascript?

I see this pattern a lot (which I actually use) but I want an explanation as to how it works. var mystuff = function() { var blah = function() { }; return { setup: function() { blah(); }; }; }(); Then usage is very OOP like: mystuff.setup(); ...

Placing an image inside of a text field with HTML/CSS/JS?

Is there any way to place an image inside of a text field with HTML/CSS/JS, not using the image as a background? The image needs to be clickable and positioned on the right of the field, too. Thanks. ...

Do I need to namespace my JavaScript code if it's in an <iframe>?

If I write some JavaScript that runs in an <iframe> (which is dynamically created and added to the DOM with JavaScript, if that matters), is it isolated from the global namespace of its parent page, or are conflicts still possible? I did some Googling and came across this page, but I can't really make sense of what he's doing here, or i...

Is it a bad idea to auto generate javascript code from the server?

I'm developing a facebook app right now all by my lonesome. I'm attempting to make a javascript call on an onclick event. In this onclick event, I'm populating some arguments (from the server side in php) based on that item that is being linked. I'm inserting a little bit of JSON and some other stuff with funky characters. Facebook expe...

Ext JsonStore doing a POST even if I set it to GET

I have a jsonstore that is supposed to load a user's information. I have its HTTPRequest as a GET but when I finally do load up the store with parameters, it automatically changes to a POST request. I've done something similar to this before, except it was a regular datastore, and the request stayed as a GET. Is the default behavior...

Parsing json in jquery

I have a php file somejson.php that echos a json encoded array {"jsonone":"first json","jsontwo":"second json"} I'm trying to access the response with jquery ajax to use this data outside the score of the ajax call. It keeps giving me all kinds of object(Object) or undefined errors. I'm guessing it's something as easy as wrong synta...

[PHP/JavaScript]: How to call a JavaScript function through PHP and fetch value returned?

I want to call a JavaScript function through PHP and store the returned value in a PHP variable. How to do this? ...

How to prevent multiple html selection box displayed on screen?

Hi All: I have been working on the last bit of my php + ajax based datagrid project.Everything works as I designed except one thing : I cannot stop user opening multiple selection boxes... Go my research page and use username "ChenxiMao" and password "accedo" to login(without double quotes). Note that perhaps the images used in th...

How can we know what parameters are passed into a callback function in YUI?

From http://developer.yahoo.com/yui/docs/YAHOO.util.DataSourceBase.html#method_sendRequest,you can see the oCallback is an object literal with the following properties: success The function to call when the data is ready. failure The function to call upon a response failure condition. The problem is that it does not mention what paramet...

jquery: how to ignore immediate children() and go deeper until match specified element ?

$(this).parent().parent() .children(this.attr("tagName").toLowerCase()) .css("background-color", "yellow"); xpath: /html/body/div/table/tr/td/b/a $(this).tagName is Anchor <a> the problem with this is that children() looks at the immediate children of $(this).parent().parent(). Hence it will highlight <b> instead of <a> i need a ...

FTP files in Windows Scripting Host?

Hi What is the recommended way to transfer files via FTP and manage (rename, move, delete) files in an FTP server programmatically in a Windows Scripting Host script file (JavaScript/VBScript)? Preferably without requiring 3rd party ActiveX add-ons since these "extra" software will need to go through an approval process that will take ...

javascript error for the textbox

hi, <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick ="toggletr();" /> <script type ="text/javascript" > function toggletr() { debugger; var Inputs =$get("TextBox1"); } </script> i trying this i am getting error: Microsoft JScript runtime error: Object expected but in textbox it contains v...

Browser performance question.

Using an adapted version of jquery.inplace.js for some page creation and use an OBDC connection in the background php file to query for content. Everything works, BUT... I am surprised that IE6, 7, or 8 are all pretty quick, as is chrome, but firefox seems to take quite a few seconds for exactly the same task, in this case. This is wit...

How can I find the week which a day belongs to using javascript?

I want to find the number of the week which a day belongs to in javascript. My definition of week is the number of saturdays there have been up to that date. So the first few days of january are counted as the final week of the previous year. From there, the first saturday to the preceding friday is week 0 (0 based week counting). Anyon...

Passing Table values to action class

In one of my web pages I have a HTML table. This table will have 0 or more rows and each row has 3 columns. It looks like this: <table> <tr> <td>Row1-Col1</td> <td>Row1-Col2</td> <td>Row1-Col1</td> </tr> <tr> <td>Row2-Col1</td> <td>Row2-Col2</td> <td>Row3-Col1</td> </tr>...

building java script debugger for rhino

hi, i am using tomcat server and i have added a rhino engine to able some scripting abilities on my users. the second phase is to provide some debug environment. i know rhino has a debug API but i could not find any documentation/code samples about how to work with it, and build a debugger around it any one knows? ...

Generating HTML Forms With Javascript

My app uses javascript to generate all the HTML for my website. The index.html basically just contains <div id="menu"></div><div id="content/><div id="content2/> And the javascript replaces the divs. I find myself doing a lot of repetitive tasks when I need to create a form. var html = "<form id="form1"> ... </form>"; Is there a go...