javascript

How to disable/re-enable JSF component using javascript ?

Hi everybody. I'm developing a JEE application (JSF2 + richfaces 3.3.3 + facelets). I want to disable my h:selectOneMenu when loading my page, and when it finishes loading (using the funtion onload()), i want to re-enable my component. I have something like this: <ui:define name="infosHead"> <script type="text/javascript"> ...

Min Width in Window Resizing

Hi, I have a webpage with a fluid layout with a 100% width. When I resize browser window the elements in the page overlap. I would create an effect similar to this website http://bologna.bakeca.it/ that when window is smaller than a fixed width stop resizing. ...

Why isn't flickr.galleries.getPhotos displaying the images?

Hi all, I asked a question the other day, but was a bit too in depth about the problem, which was confusing. Anyway, I've not made any progress, but wondered if a more succinct question could be answered by anyone. I'm trying to display photos from a Flickr gallery using the 'flickr.galleries.getPhotos' API method. I have the desired r...

Pass a callback in ExternalInterface

I want to call a Javascript function from Flash, which I can do with ExternalInterface, but the Javascript function takes a callback. Is there a way to give it a Flash callback? I've thought of something like this: ExternalInterface.addCallback("foo", function(){...}); ExternalInterface.call("theFunction", "foo"); But that wouldn't w...

Click event does not fire default action

So, I have this <ol> with some events attached with the help of jQuery (1.4.2). All is done in the $(document).ready()-call. The weird thing is that the click on the <li> does generate a click on the correnct <a> (I can see this by uncommenting the console.log()-part) but it does not navigate the UA. Why is this? Does event.stopPropagat...

Problem opening page with javascript pop ups in android webview

I am very new to both Android WebKit and JavaScript. I have a web page with 3 links (say A,B,C). When I open that page on my PC browser(Chrome) and click on the links, A opens in the same browser window, whereas B and C pops up a new window. In my android application I am loading the original URL in a WebView. I have implemented my WebV...

validation not working still submitting the form.

Now here is another problem.. my code: <script type="text/javascript"> function validate_form () { if ( document.myform.tele_caller.value == "" ) { alert ( "Please insert the Name" ); return false; } else { return true; } } </script> and the form- <form action="telecallerinfo.php?action=modify&id=<?php e...

RegEx JavaScript problem

I have this text: <body> <span class="Forum"><div align="center"></div></span><br /> <span class="Topic">Text</span><br /> <hr /> <b>Text</b> Text<br /> <hr width=95% class="sep"/> Text<a href="Text" target="_blank">Text</a> <hr /> <b>Text</b> -Text<br /> <hr width=95% class="sep"/> **Text what i need.** <...

without closing the popup window, how to submit the form value to server

Question: I have one popup window it contains some values in textbox and textarea. I need to submit the value to server without closing the popup window. Is there any way.... Thanks in Advance ...

Javascript timer

I have a set of objects and each those object keep track of some strings. Those objects are created at page load and stored in an object array. I have four user controls in ascx file that displays those strings of a particular object at a time. And also I have a play button in the same ascx file which is default set to play. When I load...

How can I delay checkbox postback?

I have an ASP.NET page with Javascript. I have some checkboxes and I want to give the user time to check and uncheck more then one box before the postback... so when the user tick/untick a check box the postback happens after 5 seconds. How can I do this? tryed different methods found online but all incomplete or wrong. Thank you! ...

Add options to a DropDownList using jQuery in Code Igniter

Hello, I'm looking for a way to add a custom option to a drop down select list with Jquery. So the user would click the drop down, and be presented with a list of options, the last being 'add other...' once they click this they can then enter an option of their own (through a pop up, popover, directly inline or however.) There's the po...

Accessing properties of html element inside javascript function using $(this) gives undefined

I am calling a function test() on an anchor tag like this:- <a class="link" onclick="test();">Hello</a> And I am trying to access the class of the anchor inside the function test():- function test() { alert($(this).attr("class")); } But this alerts undefined. I know that calling onclick=test(this); instead and having the followin...

How to extract the fragment between the body (<body>...</body>) tags from AJAX response in JavaScript

An AJAX response is returning the full HTML page. I need to extract the fragment between the body (<body> and </body>) tags. This is required to be done on the client side using JavaScript. Any help will be appreciated. ...

How does gmail report a bug works - technically?

How does gmail report a bug works - technically? By this I mean.. what HTML, JS techniques they may have used to get screenshot plugin kind of interface.. and technique. Thanks ! ...

JScrollPane vanishes when page is refreshed in Chrome

Hi Guys, I've implemented vertical JScrollPane in to a site i'm designing. it displays correctly in Firefox and IE but in Chrome it displays correctly on page load and when accessing other links that have the scroller on. However, if I simply refresh the page the scrollbar vanishes. Any help would be greatly appreciated! jScrollP...

Enabled/Disable controls in Xmlhttp Response

I have a page that has 3 to 4 divs with gridviews in each that get data loaded using Ajax Xmlhttp calls. Now the problem is that I have checkboxes in the grid and need them to be disabled/enabled when they load to the main page in the div. When i set the Enabled=false tag in the ASPX page to the checkbox, the UI throws an "Object requi...

how to highlight part of textarea html code

I want to achieve a python version web regexbuddy,and i encounter a problem,how to highlight match values in different color(switch between yellow and blue) in a textarea,there has a demo what exactly i want on http://regexpal.com,but i was a newbie on js,i didn't understand his code meaning. any advice is appreciated ...

Best way to create custom build system for JavaScript, for automated builds?

How to create a build system for number of JS client applications, all using same framework but different combinations of framework parts? This would enable all client applications receive the framework updates automatically, without having to rely on one distribution file, containing all framework abilities (which would be rather sub-op...

Saving text and inserting it after a specified variable

Hi all, there's a site with lots of comments. code1 <p>hello ernie</p> <p>this is mark</p> <p>hello ben</p> <p>this is ernie</p> <p>hello mark</p> <p>this is ben</p> Now I want to collect all comments containing 'hello' and insert the phrases with hello after all comments. $("p:contains('hello')").insertAfter($("#comments")); 'he...