javascript

Javascript tools for building something that looks like a cable program guide

I am looking for some tools or examples of code to help me build something that looks and behaves somewhat like a cable program guide. The general idea is that this will be an administration UI to schedule assets on individual channels. Scheduled assets cannot overlap on any given channel. I found at least one decent looking scheduler (...

Javascript pop-up over Vimeo video - CSS layout order

Is there such thing as a layer or an order of items that conflict in the same space? I have a pop-up signin box, somewhat similar to Twitter.com, but when it pops open, it is behind a Vimeo video in the middle of the screen. Is there a CSS style to make it appear on top of the video instead of behind it? In graphic design tools there ...

How To Post XML via JavaScript to REST API?

Hi there. I'm trying to POST XML via JavaScript to a REST API. The Request Data looks like this: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <EditGame xmlns="http://blahblahblah.com" > <playerCount>2</playerCount> <score>2621440</score> </EditGame> How do I define the postString above if my code looks like this below: ...

Extending Firebug (Firebug/FBL is undefined)

Firefox 3.6.8 Firebug 1.5.4 I'm trying to write a Firefox extension that uses Firebug. I've gotten up and running with the Firefox extension part but I just can't seem to access Firebug. I've followed various tutorials and dug into the code of other Firebug extensions (such as FirePHP). From what I can tell, this should work (at it...

Regex match for beginning of multiple words in string

In Javascript i want to be able to match strings that begin with a certain phrase. However, I want it to be able to match the start of any word in the phrase, not just the beginning of the phrase. For example: Phrase: "This is the best" Need to Match: "th" Result: Matches Th and th EDIT: \b works great however it proposes another ...

How do I get an item from a JavaScript object?

How do I get an item from a JavaScript object: var items = [ { ITEM:1, AMOUNT:10 }, { ITEM:2, AMOUNT:20 } ]; I want to be able to do something like this: $(items).filter(ITEM == 1).AMOUNT; ... which would return 10. ...

What is a regular expression and C# code to strip any html tag except links?

I'm creating a CLR user defined function in Sql Server 2005 to do some cleaning in a lot of database tables. The task is to remove almost all tags except links ('a' tags and their 'href' attributes). So I divided the problem in two stages. 1. creating a user defined sql server function, and 2. creating a sql server script to do the upda...

how to use javascript on AspxGridview

<dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" ClientInstanceName="ASPxGridView1"> <Columns> <dx:GridViewCommandColumn VisibleIndex="0"> <EditButton Visible="True"> </EditButton> <NewButton Visible="True"> </NewBut...

Insert javascript file inside iframe

I'm trying to do the following: <iframe width="300"> <script type="text/javascript" src="file.js" charset="utf-8"></script> </iframe> But this constructions seems not working. What is the legitimate way to insert javascript file inside iframe using HTML and not calling javascript functions? Is it even possible? ...

Create dynamic paging with javascript

I am calling a SQL search query and based on the number of results, generate pages with a set amount of results on each page. I want to be able to generate a drop-down menu to select which page to navigate to. How would i go about doing this using javascript and cookies? Any help pointing me to the right direction would be great. (links...

Javascript redirect to SSL causing 'partially encrypted' error

My website's login uses AJAX to post the credentials. It then checks for an 'error/success' to be returned and then acts accordingly. This has worked fine up until I wanted to add SSL. Original code: if (output == 'success') window.location=window.location; Replacement code: if (output == 'success') window.location=String(win...

JQuery Validation Bug or User error?

Site in question: http://tinyurl.com/23oar6z You can look at the source for the javascript on the JQuery or the main part here: // validate signup form on keyup and submit var validator = $("#Register").validate({ rules: { UserID: { required: true, minlength: 2, remote: { ...

Javascript IE Issue

This is a code for a WYSIWYG text editor I am working on. I'm working on the HTML to BBCODE and vice versa part now. It works fine in Fire Fox but not in Internet Explorer. Thoughts? function textstyle(a) { document.getElementById(a).style.visibility = 'visible'; document.getElementById('editor').contentWindow.focus(); } functi...

Calling JSF ManageBean after PageLoad using f:event postAddToView

Hi Guys, I am writing an app using JSF 2.0. For one of the page, there is a section of the page that takes a long time to display. To improve the user experience, I am thinking to load the page first and then automatically do an Ajax call back to the JSF manage bean object once the page is loaded successfully after 1st load. I am t...

How do you use non captured elements in a Javascript regex?

I want to capture thing in nothing globally and case insensitively. For some reason this doesn't work: "Nothing thing nothing".match(/no(thing)/gi); jsFiddle The captured array is Nothing,nothing instead of thing,thing. I thought parentheses delimit the matching pattern? What am I doing wrong? (yes, I know this will also match in...

Does Javascript have a contains function?

Hi I am not sure if it does or does not. Some sites show using a contains in javascript but when I try it does not work. I have var userAgent = navigator.userAgent.split(';'); if (userAgent.contains("msie7") == true) {...} I am trying to use the useragent to figure out if the user is running IE 8 in compatibility mode. So I want to...

Click a button in code in Intraweb (VCL for the Web)

Lets say I have an intraweb application (written in Delphi 2010) with an iwEdit (called iweLookup) and an iwButton (iwbSearch). When enter is pressed in the iwEdit, I want the iwButton clicked. The following code almost works, but I think I need something to re-render the page. procedure TiwfLookupListing.iweLookupAsyncKeyDown(Sender:...

HTML with event.preventDefault

If the html document is disabled. (no scrolling...) document.ontouchmove = function(event){ event.preventDefault(); } Can I selectively enabled elements in the html document? such as a div, span What javascript should I use to do that? ...

PHP/AJAX check if session variable changed

Greetings! I need to dynamically check if a session variable changes every few seconds. For example, the PHP session variable "x" may have a value of "1", and then after five seconds, has a value of "2". The PHP session variable "x" is changed by using a form. If the session variable changes, I need the page to reload. How can I relo...

What are some good practices when writing Javascript/jQuery code?

Possible Duplicates: jQuery Standards and Best Practice Javascript Best Practices After finding that a website I wrote is leaking memory like crazy, I've started trying to improve the way I write my Javascript/jQuery code. For instance, instead of writing: if ($('#elem').is(':checked')) I can write: if ($('#elem')[0].ch...