javascript

Design Pattern for a generic container in ASP.NET

We have a ASP.NET 3.5 site that has multiple search pages, customized what you're trying to search for. These search pages are similar, in that they behave the same and have the same design, but the actual search fields may be different depending on what table you're searching on. I'm updating this to use div's and collapse/expand Java...

Html Helpers generates ID from model properties. How do I target 1 particular element with JavaScript and CSS if many elements have the same ID?

Hello, As it's recommended, Javascript must be kept in a physically separate file (to be unobtrusive). So how do I access a particular element in particular page? should I detect those elements by id? that would mean 2 elements can't have the same id even if they are not located in the same page. Well, for instance, using the Html help...

My first dig at jQuery

I'm a complete newbie as far as jQuery is concerned. I also don't know much of JavaScript except for some very basic stuff. I'm following this tutorial here: http://docs.jquery.com/How_jQuery_Works And nothing's working! :-) I created a folder on my machine's hard drive here: C:\rnd\jQuery Then, in that folder, I put the jquery.x.x.j...

How to insert an element at selected position in HTML document?

I want to insert an element(span,div etc) at the position determined by user selection of text in the document. I was able to get the element on which selection is made. But I am not able to get the exact position where the selection is made. For example: <span>this is testing string for testing purpose</span> In this, lets assume t...

Multiple selection of rows in table using the shift key

Hi, On my website I have used a HTML table to populate the data in rows. I have implemented functionality to select a range of rows by holding shift keys (select begin and end row and it will automatically select the rows in between). I am changing the background color of the rows for selection (I am using javascript to changing the bac...

Javascript enum within an enum

I have the following "Enum" in javascript to indicate the state of my application: var State = { STATE_A: 0, STATE_B: 1, STATE_C: 2 //... } Now, I want each state to have a "sub-state". So for example, STATE_B could be in STATE_B1 or STATE_B2 ... What would be the best way to structure this? Would I somehow nest an "enum...

Scraping websites with Javascript enabled?

I'm trying to scrape and submit information to websites that heavily rely on Javascript to do most of its actions. The website won't even work when i disable Javascript in my browser. I've searched for some solutions on Google and SO and there was someone who suggested i should reverse engineer the Javascript, but i have no idea how to ...

Formatting a JavaScript date into a string for JSON DeSeriailization.

Hi, I am using the .NET NewtonSoft JSON serialization library and it is expecting date fields in this format: "UpdateTimestamp":"\/Date(1280408171537+0100)\/" Does anyone know how I can format javascript date object into this format? Thanks Paul ...

Best way to generate javascript code in ruby (RoR)

Hi, I have seen some rails plugins which generate javascript code dynamically using ruby. 1. %Q ( mixed block of javascript and ruby ) 2. <<-CODE some mixed ruby and javascript code CODE Being a java developer I don't understand what those strange looking syntax mean ? Is one way better than the other ? can anyone point me to...

Javascript date functions

Hi, I'm having problems with the following JavaScript code. I coded in the comments what's happening: function fetchMaand() { var dteBegin, dteEnd, clsDate, monthsAhead; monthsAhead = $('#dteMaand').val(); // dteMaand's value = -3 for example clsDate = new Date(); // Current time clsDate.setMonth(clsDate.getMonth() + mo...

Problem displaying popup ( java 1.4 )

I have a JSP with some fields. When I fill in the fields and click the send button, I have to go check that the data in database exists; if it does not, I display a popup alerting the user that the data does not exist in the database. If they choose to continue anyway it goes on the screen; if not it returns to the starting point. I'm s...

html- / styling of- tooltips in google maps api v3

I'm trying to work out how Google adds images and styling to their tooltips that appear over markers in google maps. An example of the desired behaviour can be seen here: http://maps.google.es/maps?oe=utf-8&amp;q=hotels+in+sydney If you mouseover one of the hotel markers, you will see different styles (bold text, normal text), paragra...

TabPanel Internet Explorer Problem

Hi, I have a TabPanel where each tab is a ManagedIFrame. A dark blue block (below the tab panel) as shown in the image gets added whenever a new tab (also a maangediframe) gets added. It happens only in IE 8. It does not happen in Firefox. Any suggestions? image: http://www.sencha.com/forum/attachment.php?attachmentid=21712&amp;d=128034...

Ajax query to my webservices is returning xml in my json - Part 2

Hi It's me again (previous question) I am still having problems with json and xml being returned from an ajax call. I have written a webservice in MonoDevelop version 2.2 to return my json. [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string getLocationJ(){} Which returns:- JavaScriptSerializer js = n...

javascript object memory and webpages.

Suppose a javascript holds an object on page A (www.example.com/a.html) Suppose the user clicks on page B (same domain) (www.example.com/a.html) is it possible for the javascript on page B to access the object from a.html ? I don't want tricks to transfer the object, like posting to the webserver or adding parameters to the url. T...

Display a truncated string using Eval

I have a ASP gridview control. I have a ASP label control in the item template column. I bind data to the grid using - <ItemTemplate> <asp:Label ID="lblDesc" runat="server" Text='<%# Eval("Description") %>'></asp:Label> </ItemTemplate> But, the value of this string can be upto 80 characters. But, I cannot afford to have the c...

Append custom attributes to a DOM node

Possible Duplicate: Can I just make up attributes on my HTML tags? Hi, I am not sure if what I am asking is even possible, but I'd like to be able to add a custom (nonrendered) propery to an existing HTML DOM node. For example, if I have a simple DOM as below: <body> <p> <span id="aSpan"></span> </p> </body> .. I'd l...

JavaScript and third party cookies

Say there is a site foo.com which loads JavaScript from site bar.com. Now, say the JavaScript from site bar.com tries to read cookies using document.cookies. I was under the impression that using JavaScript, you can read all the cookies set in the browser irrespective of their source. But it turns out that the JavaScript from the site ba...

How to access Flash object's data via JS code.

I am using an opensource flash video player F4player on my webpage. I have to play next video upon completion of currently playing video. How can I do this using JavaScript? How can I can check the playing state? If this is not possible without editing the actionscript file, then can you please suggest some free/open source alternative...

Disabling works in IE8 and not in lower versions of IE

I have a jsp code like this <html:option value="${apealstaList.appealStatusMasterId}" disabled="true">${apealstaList.appealStatusDescription}</html:option> This disable the options and it works fine in IE8 and not working in the lower versions like IE7 and IE6. Please help me in this issue. EDIT Please share If there are any other a...