javascript

jquery create a tooltip that does not disappear

Hello, I am looking to build a tooltip that allows the user to click links within that tooltip to allow them to navigate to various sections of the site. My problem is that the tooltip disappears when I leave the a with my mouse? what I want is for the tool tip to disappear if I change to a new a or click close on the tooltip, my jquer...

Need to build arrays in Javascript +=?? getting strings....

Ok basic JS 101 I know, but can't find the answer... For the below code I have declared var mls_link = []; In globals The data.getValue yields a string item (http addresses) When I step through the code the string is an array rather than each "item" being a array entry.. ie mls_link [0] is h (the beginning of the http address) I want e...

Rails after_filter get javascript and stylesheet values

Is it possible in rails using a filter that appears, after the view (after_filter), to collect the data that has appeared inside of the javascript_include_tag and stylesheet_link_tag methods? for example: ---rails view starts javascript_include_tag 'file.js' ---rails view is complete and after_filter runs @js_files = get_included_java...

What is the most elegant way to randomly set a page background color between two choices?

So I run this site: http://sometimesredsometimesblue.com And more or less out of curiosity I was wondering if there was a more concise/elegant/interesting manner of how to code the... "functionality". var redOrBlue=new Array("#0000FF", "#FF0000") document.bgColor=redOrBlue[Math.floor(Math.random()*redOrBlue.length)] There's nothing ...

Using setTimeout to bypass IE script warning

Hi, I'm trying to write a web app that uses Javascript to perform a fairly complex calculation (involves factorials and Bessel functions). When I run the script in IE, it gives me a warning that the script is unresponsive or taking a long time, and asks if I want to continue running it. I've read that to get around this, you can use e...

wysiwyg Inserting an image

I have been trying without any luck for a few weeks to make this happen. Right now I can click on add URL to add an image URL. What I want to do is have an onlick from images from my page and have them insert into the editor. Im really lost on this, any ideas? Because I am so lost on this and need it to work I'm willing to pay for help...

Stat Counter Not accurate all of a sudden on my site

Stat Counter Not showing Accurate Hits Webiste: www.curbappealconcepts.com I have pasted xhtml code into the head tags of my site.master page for the stat counter. This site was built with Visual Studio 2010 in C# ASP.NET I dont know if any of this matters just wanted to be thorough. The stat counter im using is from www.statcounte...

Is there a practical reason why I would choose a closure over an object?

I've been getting into OOP javascript recently and more and more I've been hearing about closures. After a day of twisting my brain I now understand them* but I still don't see the advantage over using an object. They appear to to do the same thing but I suspect I'm missing something. *i think Edit I've just spent 20 minutes trying to...

Finding the origin of JAR files from source code to determine frameworks used?

I'm doing some project maintenance on the source code for an MVC JS website running on JBoss. The project contains both Java and Javascript and I'm trying to figure out all of the frameworks that were used on this project, seeing that the Javascript code is somewhat lacking in project documentation. In WEB_INF/lib/, I see these files: ...

Limiting web logins to a single machine

For a password protected site, is there a way to allow users to log in to the site multiple times as long as it's on the same computer (even in different browsers)? One way I have thought to do it is always send MAC address on login, but that's not available in browsers. Is there some other way of doing this? ...

Creating local XML Feed from remote URL and displaying in xsl/asp/html

The title pretty much says it all! If anyone could help it would be amazing, I've been searching for hours and found nothing specific. All I have is the feed URL which I need to import, style and incorporate somehow. Our site's in ASP. Is there a feed src I can use in xml to import the feed directory and style in xslt? Any info, m...

Why won't my JS file load?

using this code: <script src="<?php bloginfo('template_url'); ?>/scripts/hovermenus.js" type="text/javascript"></script> to load this script firebug is not showing this script as loaded, however, these scripts: <script src="<?php bloginfo('template_url'); ?>/scripts/jquery-1.4.2.min.js" type="text/javascript"></script> <script s...

Trying to increment a javascript counter when using polling ajax http requests

Hi, I have a script that is running every 5 seconds, as a polling ajax http request. I want to send an incrementing amount through it, on each request (1,2,3,4,5,6 etc...) I have this so far, but the code just sends '1' through all the time. // set the value to 1 var state = { recordId: 1 }; $.ajaxPoll({ url: "map-s...

ie7 doesn't recognize a page with different anchors (hashtags) as 2 different pages (hence history doesn't work)

As part of developing some ajax history behavior I encountered a weird thing: (my) ie7 doesn't recognize a page with different anchors (hashtags) as 2 different pages. The consequence is that when using the back-button ie7 skips over all previous urls (which only differ by the hashtag). for example lets say I have browsed the followin...

jQuery check when PDF download is complete

I have a link which when clicked downloads a pdf file. Is there a way using jQuery to tell when this has occurred. Basically I want the link to change from download to please wait. And when the download is complete it will change to something else. The main reason is the pdf is generated server side and can take 10 or 20 seconds. ...

This jQuery slide show doen't work in IE 8? Any ideas on how to fix it?

<script type="text/javascript"> $(document).ready(function() { //Execute the slideShow, set 4 seconds for each images slideShow(2000); }); function slideShow(speed) { //append a LI item to the UL list for displaying caption $('ul.slideshow').append('<li id="slideshow-caption" class="caption"><div class="slideshow-caption-cont...

Differences between C# and JavaScript Regular Expressions?

Are C# and JavaScript Regular Expressions different? Is there a list of these differences? ...

falsey values in javascript

I had an interesting interview question today that stumped me a little. I was asked about falsey values. So undefined, NAn, Null, 0, an empty string all evaluate to false. What is the reason this is useful to know in javaScript? The only thing I can think of is instead of having to do this: if(mystring === '' || mystring === undefined) ...

Models in Zend Framework

Hi, I am new to zend framework. I have created "models" folder in application directory. Inside models folder I created a class Application_Models_Albums which extends Zend_Db_Table_Abstract. Now when I use the following code in IndexController. I get error: $albums = new Application_Models_Albums(); $this->view->albums = $albums->fet...

Javascript: Getting a Single Property Name

Given an object like this: { name: "joe" } I want to get the value "name". I know I can use the for construct to iterate over the properties in an object, but the objects I'll be dealing with will always have a single key:value pair, and I won't know the name of the property. To further illustrate: var a = { age: 24 }; console.log(my...