javascript

Best way to make title bounce when a new message is received and tab is inactive?

This is what I have so far, but it's ugly and feels non-best practicey. For example, if multiple messages are received, it starts the changeTitle cycle multiple times. var hasFocus = true; $(window).bind("blur", function() { hasFocus = false; }); $(window).bind("focus", function() { hasFocus = true; document.title = 'SiteN...

Node.js and CPU intensive requests

I've started tinkering with Node.js HTTP server and really like to write server side Javascript but something is keeping me from starting to use Node.js for my web application. I understand the whole async I/O concept but I'm somewhat concerned about the edge cases where procedural code is very CPU intensive such as image manipulation o...

A bug in JavaScript...

Dear all, I have trouble to figure out a bug in javascript. It sounds so simple though to debug, but I could not find out. It tells me a runtime error has occured ...Expected')' here is the code: <xsl:for-each select="./projects/project"> <script LANGUAGE='Javascript'> x = 0; if(x==...

Problem accessing javascript of user control in Tab Container

Hello All, I am new to ASP.NET so dont know much about it. I have a usercontrols in placed in tab panels of Tab container. I have written javascript for the usercontrol. What it does is I have a "CheckAll" checkbox and when I click a check it I change the checked value for other checkboxes in my usercontrol. Problem is that when I fire t...

Import javascript in php

Hi, How can i import javascript in php? No matter what i try, i can't seem to get the buttons in my page to trigger the events in javascript. This is my javascript file content: function addRow(tableID) { var table = document.getElementById(tableID); var rowCount = table.rows.length; var row = table.insertRow(rowCount); var col...

NavigateUrl and EVAL

I am trying to Navigate URL in this way <asp:HyperLink runat="server" NavigateUrl='javascript:NavigateUrl("<%#Eval("TicketID")%>","<%=RedirectURL %>");'><%# Eval("TicketID") %></asp:HyperLink> but an error occurred in the javascript Error Console in Mozilla browser. Error: missing ) after argument list S...

Strip Base64-encoded URL parameters with Javascript

I'm decoding my URL parameters in .NET as explained in this article. In some cases I need to get the URL parameters in Javascript. But the problem is that some parameter values end at a '='. Example: ?itemID=Jj1TI9KmB74=&cat=1 Javascript function: function getUrlVars() { var vars = [], hash; var hashes = window.location.href.slice(win...

Pagination problem in jqgrid with array data.

I am facing problem with pagination in jqgrid with array data having 18 records, but the records are not displaying in pages even I specified pagination:true,pager:jQuery('#pager1'). Can you please help me to implement pagination instead of scrolling. <script type="text/javascript"> jQuery("#list4").jqGrid({ datatype: "clientSide", h...

Simple Font resizer with JavaScript

Hello Gurus. I have this simple font resize build with JavaScript. It resizes app p tags on page but I need to add other tags, like li. How can I do that. Any help much appreciated. var min=8; var max=18; function increaseFontSize() { var p = document.getElementsByTagName('p'); for(i=0;i<p.length;i++) { if(p[i].style.fontSi...

Why do people say that javscript eval() is evil but you get no objections against setTimeout and setInterval etc ?

if I am not mistaken eval executes valid code in a given string eval("alert('hey')"); and setTimeout("alert('hey')",1000); does just about the same thing, only with a timer. is set timeout just as risky as eval? ...

Throbber of Doom in Chrome/Safari

Hi, Is there any way in JavaScript to Stop throbber of doom in Chrome/Safari browsers, when using push technology (Ajax Comet) with iframe. ...

jCarousel + jQuery Accordion + fadeIn

Please check this link www.aboud-creative.com/demos/mckinley3. There I have a jQuery Accordion with jCarousel inside "Developments" section of it. I use standard fadeIn function for the logo, accordion and a stag on the bottom right to fade in on page load. So, When you go to "Developments" section, you will see there are no images shown...

How to add a CSS class to a table row after loading a page in an iframe with Jquery

Hi, I'm loading a form in an iframe (with facebox). When the form is submitted and the page inside the iframe is reload, I would like to add a css class to a specific table-row on the parent page. the table looks like this: <table> <tr id="row-1"><td><a href="">link to open facebox with iframe</a></td></tr> <tr id="row-2"><td></td></t...

ASP.NET beginner question regarding Hover effect

I am a complete beginner to ASP.NET and need to know how do I create the hover effect like in the following website:- http://www.viking.com/Chairs/Chairs.asp There's this link "Shopping cart" in the upper right hand corner of the web page...when you move your mouse over it, a text box is shown.. How do I create that effect ? I just ...

Dynamic property getters/setters in Javascript?

Storage (localStorage, sessionStorage) allows using arbitrary properties. E.g. you can do localStorage.foo = 'bar'; instead of localStorage.setItem('foo', 'bar'); Can my own javascript objects have the same behavior? I want to execute some code, when a property is attempted to be set. Note: I obviously know I can create setters, b...

How to get AJAX coding to go into PHP??

I have this PHP coding (See below) and I'm trying to include a Ajax drop down list into the input form. The javaScript and PHP page both work fine with the normal html form that is inserted right at the bottom of the page. I believe the problem lies in this piece of coding, because it isn;t picking up the "ch=" value NORMAL PAGE (FO...

selected tr inside the table

Hi I have a table which has 5 rows. When a user clicks on a TR I want to know which row was clicked on (I mean the row number, i.e. 2, 3, or 5). Does anyone know how to do this? ...

Search my site with bing through form without javascript

I'm hoping to find a way to use the Bing search engine to search only my site through a html form without javascript. Google handles it this way: http://www.google.com/search?as_q=Sharepoint&amp;as_sitesearch=plop.nl where I can use these fields: as_q and as_sitesearch. Does anybody know of something like this for Bing? ...

How do I get different timezone date in javascript?

I have timezone stored with me in a var like: timezone = "America/Los_Angeles". So by providing this timezone, can I get the LA's current time in Javascript? ...

Attribute Starts With Selector [name^=value]

I need to match some input fields by name. The name consist of a base name plus squares brackets, so the PHP interpreter converts them to array. According to the jQuery API, I could use the following selector: ":input[name^=foo\\[]" (It's okay to ignore the closing bracket.) However, it won't match any of the elements. Other variation...