javascript

How to clone js object?

How to clone js object with out reference like these: { ID: _docEl, Index: next, DocName: _el } Any ideas? ...

Regex Rules for First and Second Character

Hello, I need help on following regular expression rules of javascript and php. JS var charFilter = new RegExp("^[A|B].+[^0123456789]$"); PHP if (!preg_match('/^[A|B].+[^0123456789]$/', $data_array['sample_textfield'])) { This regular expression is about First character must be start with A or B and last character must not inclu...

how can i use a javascript in gridview row

hi there, I want to use a flash chart in a gridview. you can see my codes in below: DataTable tbl = new DataTable(); tbl.Columns.Add("chart"); DataRow rw; rw = tbl.NewRow(); rw["chart"] = @"<div id=""chart5Div""></div> <script type=""text/javascript""> var ch...

How to realize a multi-page wizard with client-side controller "rules" in JSF2 or GWT2?

In (JSF2 + jQuery) or in GWT: What would be the best way to realize a multi-page form wizard with explicitly specified form controller "rules" running on the client-side? The goal is: form with 3 pages, each containing 'prev'/'next' buttons and finally 1 'submit' button. all form items have unique ids for addressing/accessing them. f...

Retrieve the fragment (hash) from a URL and inject the values into the bean

Hi! I am looking for a way to inject values from the fragment (#) of a URL into bean(JSF), in the same way query-parameter values are injected. I am using Ben Alman's Bookmarkable jQuery plugin (http://benalman.com/projects/jquery-bbq-plugin/) to create the URL fragments. I was hoping that Custom regex patterns from prettyFaces could be...

Javascript - possible to remove element of an associative array

Is it possible to remove an element of a Javascript associative array (i.e., set back to native undefined)? When I tried simply alert(array['knownKey']); array['knownKey']=undefined; alert(array['knownKey']); ... the second alert produced the literal undefined... whereas, the first alert returned nothing. ...

Arrow in jQuery Dialog

Is there any way by which I can show an arrow tip on left of jQuery dialog? I would like to achieve functionality as mentioned in image below. How to do this with Theme roller CSS and icons? ...

jQuery datepicker onChangeMonthYear doesn't fire on current month

I'm using the datepicker inline, highlighting the dates that has events. Every time the month changes, it has to load the new events from the server. The problem is, the onChangeMonthYear only fires on months different from the current month. For instance, if the is august, it fires on all previous months (july, june, may...) and all fol...

Browsers different interpretations of a regex with lookahead

I am running a split in javascript with /\s+(AND|OR)(?=\s+")\s+/ on "email" IS NOT NULL AND "email" LIKE '%gmail.com' OR "email" = '[email protected]' Now, my understanding of regular expressions would lead me to expect obtaining the following array: [0]: "email" IS NOT NULL [1]: "email" LIKE '%gmail.com' [2]: "email" = '[email protected]' ...

Copy and paste clipboard in JavaScript. or jQuery

How do I copy content thats present in a div tag and paste it to applications like Paint, Powerpoint etc. ...

Can you fire an event in JavaScript before the user closes the window?

I want to send a ping to my server using an AJAX GET or POST, right after they close the window. Is window.onbeforeunload a good idea? ...

google maps v3 - sidebar trigger for info window and zindex

Hi, I'm moving an app for v2 to v3 of gmaps api and I'm stuck on the following problems : How to fire an event (onmouseover) from a side bar to open the respective info window and set the icon to rise to the top by increasing it's zindex. I have pasted my code so far - I have added 10 hash's above the two lines of code (found towards ...

Is there a JavaScript data table component that displays columns as rows?

I want to display a "flipped" (transposed) data table. E.g. given some data: [{col1: "abc", col2: 123}, {col1: "xxx", col2: 321}] It's displayed as +------+-----+-----+ | col1 | abc | xxx | +------+-----+-----+ | col2 | 123 | 321 | +------+-----+-----+ The rows should act the same as columns in a standard table. Is there some J...

Overlay in jQuery UI toolkit

Is there any overlay in the JQuery UI toolkit that offers a context arrow to the link/content that it relates to? ...

Upload a file to an html page with no backend?

Is it possible to read the contents of an uploaded file (through <form><input type="file">) from inside javascript with no backend? I suppose it's possible with HTML5, but what about HTML4? ...

What does JS join/split trick do?

I seen this code a=a.join("").split(""); What does this code do? I think a was a string array, but is it still a string array? does this filter out values? what does it do? ...

Howto disable client script block server side (asp.net)

I have js script block (very long one that does editing capabilities to an invoice page). I want to enable/disable this functionality on the server-side. First thing popped up on my mind was to say runat="server" to the tag, and set visible=true/false to asp.net, thinking asp.net does not render the HTML for non-visible items, so the b...

How to highlight table cells after checking a condition using javascript function whose values are fed by XSLT

Dear all, I am a new to JAVASCRIPT and I want to highlight table row if the values are not the same throughout the row knowing that I use a loop to extract the values from the XML file using XSLT. How can I do that? <xsl:for-each select="./projects/project"> <td> <xsl:value-of select="weight"/> <xsl...

Jqgrid and Zend framework trouble

I have a list of products on my site. I draw it with jqGrid. Also I have a form, to create new product, or update existing one. Is there any way to set in jqGrid, that when I press 'edit' button in grid, it redirects me to page like 'mysite/product/edit/id/{id}' Here is my grid script: $(document).ready(function() { $("#list"...

__proto__ and inheritance in Javascript

Hi! I've been studying javascript inheritance for a couple days, and although i've made quite a lot of progress there are some things I don't quite understand yet. For example, i find this behaviour quite confusing: var Employee = function Employee() { this.company = 'xyz'; }; var Manager = function Manager() { this.wage = 'high'; }; ...