javascript

Google Maps API: Create a store locator.

Hello all. Today I am trying to make a store locator using google maps' api. The store locator is to be set up like so: two areas, one with a map containing all the stores in a given area (measured in a selectable radius from a center point), and one area with a list of all the stores on the map, their information, and of course a link t...

How to call a public function in a Javascript namesapce

When I create a JS namespace (myNamespace) with a public method (myPublicMethod) jsfile1.js var myNamespace=(function() { var myPublicMethod=function(){ alert("hello world"); } return { myPublicMethod:myPublicMethod }; })(); and then have a separate .js file which encapsulates its methods jsfile2.js (function(...

mySQL sorts underscore last.

Hi, I have a column in my table that stores a string (it is a text column): varchar(16) latin1_swedish_ci The problem is, when I say "ORDER BY name ASC" it returns words starting with an underscore at the end. This is an example it returned: -a -mmddd2 -z -z3 aaa b c t _a ___- I bet I can use php to sort, but is there an easy way to...

Hiding/Showing divs using Scriptaculous

What I'm trying to do is give my user 4 options (simple links). If the click one of these, a div below is shown based on their selection. The issue I'm having is figuring out how to hide the div below if another top link is clicked. Right now I'm able to show all 4 sub-divs at the same time, where it should hide the currently visible on...

is there a Way to strip all Unnecessary MS Word Formatting from FCKEditor

hello, I have installed fckeditor and when pasting from MS Word it adds alot of unnecessary formatting. I want to keep certain things like bold, italics, bulltes and so forth. I have searched the web and came up with solutions that strips everything away even the stuff that i wanted to keep like bold and italics. Is there a way to strip ...

Useful JavaScript libraries? including JQuery and beyond...

This question is no longer just about UI Being rather new to the whole JavaScript/JQuery/JQueryUI lark, I have just discovered the Yahoo User Interface Library. I'm sure there are other free and fully functional JavaScript libraries out on the web that I should be aware of. Around UI design, or really, anything. ...

html file upload as part of another form

Idealy I would like to have the following: <form1 ...> ... <form2 ...> //This form uploads a file using AJAX and writes the content into a text field below. </form2> <input type="text"/> </form1> Firefox handles this but IE likes to follow the rules of W3C this time and it doesn't really work. So now...

In jQuery, how to load ajax content after a specified element

I have the following HTML: <div id="mydiv"> </div> I would like to load content using jQuery so it appears after my DIV. I've tried this: $("#mydiv").load("/path/to/content.html"); However, this ends up with this result: <div id="mydiv"> <p>content from file</p> </div> How do I get this result? <div id="mydiv"> </div> <p>conte...

Can I make this into a javascript function?

$("#tab1").click(function(){ loadTab(1); $('div.HOMEtabdiv ul.HOMEtabs a').removeClass('selected'); $(this).addClass('selected'); }); Would it be possible to make the code above into a function where I could just call it like tab(TAB NUMBER HERE); and have it add/remove the correct styles/divs? The whole code f...

Web Browser Javascript Support Reference?

Hey all, I'm looking for a list of which browser versions support what javascript features. Obviously the more complete the list the better, but I'd be happy with a list that correlated javascript stuff from 2009 with IE8, Firefox 3.5, and Webkit 526. Something like this contrived example: Feature Environmen...

Get element position relative to page bottom

I use this function to get the y-coordinate of an element relative to the page: function getY(oElement) { var curtop = 0; if (oElement.offsetParent) { while (oElement.offsetParent) { curtop += oElement.offsetTop; oElement = oElement.offsetParent; } } else if (oElement.y) { curtop += oElement.y; ...

Can I get the google geocoder to tell me when a location can't be found, instead of just picking the center of a city?

I'm working with the google maps API, and testing a section which geocodes all the addresses in a database which do not have coordinates, then generates a report of which were successful, and which failed. If any of the locations couldn't be found, it should put a form at the top of the page to allow the user to either modify the addres...

how to schedule ajax calls every N seconds?

If I want a whole page to reload every N seconds, I would put something like this in the HTML: meta http-equiv="refresh" content="5" Is there a standard practice for doing the same kind of thing for AJAX calls? I want schedule an AJAX call to go off every 10 seconds say, in order to update parts of the page, without refreshing the whol...

How to add to a mouseover javascript menu?

I currently started working on my school's website and have already encountered a problem. There has been a request to add a link to an existing menu that has been around for a couple of years. The menu is javascript and I really don't have any experience with it. I just know HTML. I think, but am not sure, that it's just mouseover and i...

How do we change the name of a html select element using javascript and only the tags' name to reference to ?

HI! I have a problem with changing the name of a select element. I have about 28 select elements generated on the page. Each of these select elements has been given the name "dropdown". I use this name to calculate the total based on the option selected. But when i pass this information to a php page, it shows only the last select elem...

Trouble including .js file into php

I am trying to include a .js file into a php file. My folder structure looks like this: root ---js (FOLDER) ------file.js ---blog (FOLDER) ------index.php ------js (FOLDER) ---------blog.js If I am using this: <script type="text/javascript" src="../js/blog.js"></script> it works just fine. What I can't seem to do is include file.j...

User Testing of Website

Hi All, I am searching for a web service which can record the actions done by my clients on my website. There is a service known as "Userfly", but this service is a paid service. They offer the service for free 10 recordings per month only. If you guys know something similar to this but for "FREE" please share and also i would like get ...

How to get an element's top position relataive to the browser's window?

I want to get the position of an element relative to the browser window (the viewport in which the page is diaplayed, not the whole page), how can this be done in javascript? Many thanks ...

Javascript/ jQuery and regex

I"m building a registration form, and I need to validate the user's inputs. (username, email, password). I have regular expressions set up for each of these, and I can easily validate each in PHP using preg_match, and if it returns false, I can display an error. However, I think it'd be much nicer if the page did not have to refresh to...

Hiding email from spambots without using javascript

I have a "contact us" form that uses Ajax (i.e. relies on asynchronous requests). In case the user has javascript disabled, I want to display a message, saying something like: You need to enable Javascript to use this contact form. If you can't, or don't know what Javascript is, then use your email and contact us at <the_email_addre...