javascript

Placing Place Holder for Image

I have an image icon in an HTML page that should show right to a label only when some condition is true. If the condition is false, it should not show, but it should still take up the same space. I'm sure most of you have done something like this and I got a couple of solutions. Put the img tag as usual but add to its style attribute ...

Submitting the value of a disabled input field

I want to disable an input field, but when I submit the form it should still pass the value. Use case: I am trying to get latitude and longitude from Google Maps and wanna display it, but I don't want the user to edit it. Is this possible? ...

jQueryUI DatePicker Customizing the Year

I have a Datepicker using jqueryui DatePicker. The behavior requirement is: A User can store a Birthdate for a friend. The User should be able to store a year if known, or select "N/A". If "N/A" is selected, Store the year 1900 in the database and only display the day and month in an input field to the User. The dropdown should star...

Detecting of scroll bar is visible in the UIWebView

I need to detect if the scroll bar is visible in the UIWebView, how do I do this? My first attempt was: int scrollHeight = [[webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.scrollHeight"] intValue]; if(scrollHeight > [webView frame].size.height) NSLog(@"Scrollbar is visible"); But the scrollHeight is alwa...

Dojo Select widget not selectively querying contents from datastore

I have been trying to use the query functionality of the ItemFileReadStore to filter the list of a select widget's selectable options and it seems that my queries are having no effect on the widget. The query is being done through the onChange event of another select widget, my objective is that when one widget selects a value the other ...

Emulate a click on Gmail for QA

Possible Duplicate: Emulate a click on Gmail for QA Hi, I'm writing some scripts with Fake for some QA routines. However, I'm having some trouble with emulating the a click in Gmail. The basic idea is to activating an account with an activation link. So I'm pretty stuck with the QA routine right now. I thought Javascript ca...

Events not getting rendered with JSON feed.

I am trying to use a JSON feed to render events in fullCalendar. Here is the code. $('#calendar').fullCalendar({ editable : true, selectable : true, select : selectionMade, eventResize : eventsChanged, eventDrop : eventsChanged, selectable : tru...

Check URL for page name

I have some code that someone wants to put on their site. Here is the code i received from them: <script language="JavaScript" src="http://dm4.contactatonce.com/scripts/PopIn.js" type="text/javascript"></script> <script language="JavaScript" src="http://dm4.contactatonce.com/PopInGenerator.aspx?MerchantId=44542&amp;ProviderId=3176&amp;...

C# and JavaScript results from same regular expression string are very different - how can I make results more consistent?

The reg ex string is as follows: px\">(.+)</SPAN When I use this code with this expression in C#, and compare with the body of an html document, I get back a short string like so: Match match = Regex.Match( fullText, regExString, RegexOptions.IgnoreCase ); .. gets px">Cart is empty </span><a href="http://www.somesite.co.uk/shop/ca...

invalid argument for .css()

I'm using this code with jquery $(".tab").css({'background-color': '#f3f6ed', 'border': '4px solid rgba(0,0,0,0.1)', 'border-bottom': 'none'}); It's to change the style for a tab when I click on it. It works in browsers expect for explorer (stupid microsoft..) I get "invalid argument" Not sure how I can fix this. ...

Autocomplete jQueryUI appears below the lower edge of visible screen in IE

I have problem with Autocomplete, it works well in all browsers except for IE. I have it positioned inside <td> (and <tr> and <table> of course) that is inside <div> that has CSS like this: left: 10px; top: 400px; position: absolute; width: 350px; none of its parrent elements have position/width modified in any way.. Yet when I type...

Django Template Tag inside JS script

I'm new to javascript so bear with me: I'm implementing Google Maps API and I'd like the first marker's InfoWindow to open when the template is first rendered but ONLY if certain condition is true. so, I have something like this: {% if project %} //the following is automatically open the infowindow of the FIRST marker in the array whe...

How to display the content of a tab when a button is clicked

I have a page, home.php. On the page, I have CSS tabs tab1 and tab2. The tabs are on the same page not different pages. I want the content of tab2 to display whenever I click the submit button in the content of tab2, not take me back to tab1. How can I use JavaScript to implement this behavior? <html> <head> <title>home</title> </head> ...

What is the best way to serve small static images?

Right now I'm base 64 encoding them and using data uris. The idea was that this will somehow lower the number of requests the browser needs to make. Does this bucket hold any water? What is the best way of serving images in general? DB, from FS, S3? I am most interested in python and java based answers, but all are welcome! ...

When OnResize doesn't notice you resized

Window -> IFRAME -> DIV I have a window, that has an iframe, that has a div. The div has the ability to scroll the content within but not having full control of the parent window, I have to decide how large the div needs to be from within the iframe. To do this, I have the following code JavaScript (please pardon the mix of jQuery/st...

Is jquery UI is getting loaded when sourcing fro Google Ajax cdn?

As has been discussed at breadth in many a forum, it is recommended to use Google's CDN for loading common js libraries. I am doing the same in my app and am loading jquery and jquery-ui from the Google cdn. Now there have been quite a few instances where users have reported broken UI and that is a result of jquery ui not firing. e.g. ...

Why don't number literals have access to Number methods?

If you look at the ECMAScript 3 specification you will see that primitive value types Null and Undefined don't have accompanying Null and Undefined Objects. >> Null ReferenceError: Null is not defined The other primitive value types Number, String and Boolean types do have accompanying Number, String and Boolean objects which you can ...

stoping javascript from getting executed

Hi, is it possible to prevent further execution of javascript? i include some javascript scripts with php in a header (with echo ''), but there are coming some other scripts later in the page which i can not always control, so it could be that my before included (with ) mootools javascript get later overwritten by another included moot...

How can I get, manipulate and replace a text node using jQuery?

Here is my code: <li class="det_price"> <a href="/designer/customize/278258?dpid=1">Printing</a> from $10 </li> I have about fifteen chunks like this on any given page, and I'd like to take the text node (from $X), select X using a regular expression and set it to a numeric variable, then multiply it by a %, and append it to the ...

splitting a string in js where a pattern DOES NOT match?

i am trying to split a TextArea value where a pattern does not match the text is like following: Some Good Tutorials http://a.com/page1 http://a.com/page2 Some Good Images http://i.com/p1 http://i.com/p2 Some Good Videos http://m.com/p1 http://m.com/p2 now i want to get only the links from the text so a better solution would be to sp...