javascript

Simple jQuery fade-in when document loads / no user interaction should be required

Platform: ASP.NET 3.5, ASP.NET Ajax intermixed I'm very green to jQuery, so have been having a hard time with what I assume to be trivial. All I need to do is create the following scenario user logs in to my site, and I take him/her to a 'dashboard' I want a nice little bar to 'fade in' with some information I want to draw his/her at...

strip span tags from string with jquery

I am wanting to take the text value of a p tag when I press enter $.keynav.enterDown = function () { var accom = $('#suggestions p.keynavon').html(); alert(accom); } This is working great but the results contain <span> and </span> tags, is there anyway I can strip those tags from the string? ...

Memory leak in JavaScript for event handing

Does the following function has memory leak? var d = document.getElementById("d"); d.onclick = function() { // blah... }; ...

what is opposite to javascript match()

if i want to match some thing with javascript i can use foo.match(); but how can i check if it not match... ...

jquery compress error

http://pastebin.com/WfsVZ4nU i got the following error when i compressed my javascript code. ...

find the text and the strip the text at a certain point

I am trying to write this funtion to grab the text value and then strip the text from after the - symbol and the - symbol itself. eg some text - is found would become some text This is what iv got so far currently it just removes the - $.keynav.enterDown = function () { var accom = $('#suggestions p.keynavon').text().r...

How to get non-standard font with effect in use of web site?

Problem is, that I need to get non-standard font (not everyone has it on his computer) with effect (from Photoshop: Outer Glow) in web site. I can use Javascript (including jQuery) and CSS3 for it, but that font should be able to highlight like any text in web. Any solutions? P.S. Font: Titillium. ...

how to handle javascript redirect correctly?

Hi all, When a user goes to the base domain http://www.domain.com/ or http://domain.com/, the page has to be redirected to http://www.domain.com/#!/news.html I mean something like this: if (window.location.href("http://www.domain.com/") || window.location.href("http://domain.com/")) { window.location.replace("http://domain.com/#!...

How to call a javascript function before OnInit() - ASP.NET

Hello I'm calculating the screen size of the browser and storing it in a hidden field and i'm dynamically creating controls on the page OnInit() based on the sizes. But OnInit() is getting fired before javascript function fires to calculate the screen size. Any ideas? ...

Iframe – let the user pick the src - any security issues?

I want to allow the logged in users to view any 3rd party content via an IFrame. Something like allowing Gmail users to view any Web Calendar they want inside an IFrame. Is allowing the users to set the IFrame Src Url a security problem? What security issues will I face? Any other need to know Tips for using IFrames will be welcome. ...

.click() event not executing

http://jsfiddle.net/M6xdq/ What I want to achieve, is - when user clicks the "read more" link: it's removed changes it's label to "read less" this new "read less" link is added to next element of it's parent (readmore_holder) "readmore_holder" is displayed; Then there should be the other part with "read less" to swap links back aga...

getElementByClassName -> getElementsByTagName -> setAttribute

I want open certain links in a new tab. Since I can't set it directly into the a tag, I want to pot the link into span tags with a ceratin class name and set the target attribute via javascript. I thought this would be easy, but I can't get it working: addOnloadHook(function () { document.getElementByClassName('newTab').getElementsBy...

Custom Selectbox (jquery script) - Non FF div scroll problem

Hi folks, I need a little help... After read and search for a while I discover a good jQuery plugin to deal with the selectbox custom style problems. I made some small modifications to make it work as I want. The plugin hide the custom select and append some div and ul tags. In Firefox 3.6.10 it works really nice, but in Chrome (6.0.4...

How to find out if value is undefined or not

Hi Everyone I have this javascript in a classic asp page... I need to find out if x.name is undefined or has a value: x=document.getElementsByTagName("meta")[i]; if (String(x.name) != "undefined" && String(x.name) != ""){ document.write(""+x.name +": "+x.content+"<br><br>"); } I am not sure why it is throwing an error: document.wri...

How to remember form values across different pages?

I need to send form values from one page to another and from that page to a third page. I would need the form values from the first page in the third page. How can I do it? I have the code that transfers form values to the next page. How can I send the same form values to the third page? <script type="text/javascript" src="jquery-1.2.6...

Create a Hash with an Array

Hi, I've an Array ['red', 'green', 'blue'] I want to create a new Hash from this Array, the result should be {'red':true, 'green':true, 'blue':true} What is the best way to achieve that goal I use prototypejs 1.7_rc2 Thanks ...

Input type only with numbers

Hi, I made a form that works only with numbers, and I want alert the user when he type letters which are invalid alert he and delete the caracther or make the input box red ..., how can I make that? ...

Retrieving JSON with JQuery

Hello all. I'm trying to retrieve JSON with JQuery from: http://www.chirpradio.org/json How do I retrieve, parse and display that JSON in a web page. I'm new to JSON and JQuery, and the onsite documentation is a bit difficult to follow. Thanks, Moemonty ...

Run Flot, Javascript on Server?

I would like to use a Javascript library (Flot) to generate charts in my application. Most of the time, the charting will be performed by clients. However, I can see that in some cases, where the same charts would be frequently accessed by all clients, it would be better to generate those charts on the server, cache them, and serve the...

Jquery: Change location in a javascript menu.

Done myself,thanks anyway to all :-) ...