javascript

perform search and result-action on autocomplete-input on button-click

I use autocomplete (http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/) for jQuery and everything works fine. If I type some letters there are suggestions I can choose from and on TAB or RETURN it performs the function defined with result(). But I know it won't last some days and a consumer of this form won't press TAB or E...

How to toggle element visibility without jQuery?

I'm writing an auction template for eBay, hoping that eBay would allow it. Apparently they don't because jquery has things like string.replace() etc. The code is very basic. $(document).ready(function(){ function changeImage(){ if($("#coin1").css("display") == "none"){ $("#coin1").fadeIn("slow"); }els...

How to add line break character on my widget's javascript for Nokia WRT?

Hi guys If anybody like me is using Nokia WRT Plug-in for Visual Studio... I've created on Visual Studio a Rss Reader Widget. Now I'm customizing it, trying to add line breaks in rss tag called "< description>". I'm trying many codes like with no luck: "Fist line\u000dSecond line" "Fist line\u000dSecond line" "Fist line\nSecond li...

AJAX and Client-Server Architecture with JavaScript

I have to program websites, but I rather don't like the static HTML nature. I prefer more of a client-server architecture. Now I've figured, that with XMLhttp, you can basically dynamically update your page and send/request for information/action to/from a server. So this would basically cover the client area. But to complete a client-...

django logging local javascript events

All.. Say there exists a template x.html in Django templates section. The contents of this page are <html> <a href="#" onclick="noserverrequest"> <input type="button onclick="noserverrequest"/> .............. </html> I have n number of buttons and hyperlinks as said above in a page. My question is how to record all the clicks that...

Can I get via javascript the HTTP expires header of a HTTP resource?

My page needs to know when the cache a included javascript file will expire, to retrieve it again. ...

Trouble with show/hide JavaScript

I am going to have an ExpressionEngine weblog that will place user designed content blocks in the footer. But, it's only going to show one at at time. My HTML looks like this: <ul class="footernav"> <li class="first"><a class="active" href="#">Get in touch</a></li> <li><a href="#">Interested in joining?</a></li> <li><a href...

Voting/rating system: How to fail gracefully when javascript isn't supported/enabled?

I'm implementing a voting system like the one used by stackoverflow. It's working with ajax sending POST request to an url. I'd like a way to fail gracefully when javascript/ajax isn't supported or enabled, a GET like /voteup/id isn't even considered because i'm altering the database. What's the best solution? I'm either considering a fo...

focus() not working in safari or chrome

Hello everyone, I have a div that has been given a tabindex, when the div is focused(click or tabbed to) it does the following: inserts an input into itself, gives the input focus this works great in FF, IE and Opera but in Chome/Safari it gives the input focus but fails to actually put the cursor inside the input (I know it gives it...

JavaScript Newb - Screen Width and CSS, ARGH!

Hello, I'm trying to write a bit in Javascript for a mobile website. I've searched all over Google and found some help, but I'm having some kind of problem implementing it. In the HTML Header (note, no CSS file specified here): <script type="text/javascript" src="scrnsz.js"></script> JavaScript: if (screen.width > 200) { link = doc...

Problem with code for For Loop

Hi, I am doing a project for school and I'm really struggling to understand how to create the code/commands for my for loop in Javascript. Any help would be greatly appreciated. The project is basically this: -There are two arrays: one set of 10 French words another with a set of 10 Engish words. They look like this: var english=new A...

Why is my onsubmit function quitting early and not returning false?

<form method="post" action="/Order/CheckOut/" onSubmit="return Validate()"> and then... function Validate() { alert($("#email").val()); return false; } The messed up part is when I take out the alert it works fine, the submit fails, but when I put the alert in, it allows the submit to go through... what the heck? I also tri...

How do I determine if a page is a MODAL

Is there any way in javascript I can see if the page I am loading is a modal? I know I can see if its in iframe by doing something like this.. var isInIFrame = (window.location != window.parent.location) ? true : false; But I wanted to know if there was code to see if it was a modal window.. ...

InDesign CS4 - Javascript - Make a TextArea Transparent

Within the InDesign CS4 designer, I can very easily make a TextArea transparent. I just right click on the TextArea within a document, select Effects-->Transparency, and within the “Effects” window that launches, I can set the “Opacity” to 0% on the Fill settings. I am attempting to figure out a way to make a TextArea transparent via j...

Programmatically set the datasource for a Crystal Report on a Crystal Server via Crystal Web Services

How can I change the data source (database server, username, password) that a Crystal report uses at runtime, running within a crystal server? I have a crystal server and have uploaded reports that have a set datasource (SQL Server 2005 hosted on SERVER A, userA, passwordA). I would like to schedule reports to run using a different dat...

how do you get the response back into the instance of the object?

If you've written a class in JavaScript that calls a remote service's API, and that remote API offers a callback, how do you get the response back into the instance of the object that made the request? I'll try to give you a very basic example FOO for making cross domain calls to BAR service which offers a callback. Please ignore the us...

getElementsByClassName & IE

I am trying to get some elems with the classname "special". I found the following script online, but it only returns an empty array. Does anyone see what's wrong? getElementsByClassName = function (node, classname){ var a = [], re = new RegExp('\b' + classname + '\b'), els = node.getElementsByTagName("*"), l = els.length, ...

refer to an element of JSON (Javascript) object.

How do I refer to an element of JSON (Javascript) object. exampe: alert(homes.Agents[1].name); <script> var homes = [ { "Agents" : { "name" : "Bob Barker", "name" : "Mona Mayflower" }, "Listings" : [ { "h_id": "3", "city": "Dallas", "state": "TX", ...

How to insert <script> with Prototype?

I'm using Prototype insert function to appent some html which contains <script>...</script>. And within this script I'm defining a new function. And as I read here Prototype runs script that is inside <script> tags and then removes it, but all functions should remain accessible. But from that moment I can't run my new function. $('som...

What are good PHP and MySQL type Blogs to read?

I searched and found many topics similar to this on Stackoverflow, but they were all for languages that I do not use. I am interested in reading good blogs with an RSS feed in topics related to PHP, MySQL, Javascript, jQuery. I have a few listed below so far, please share with me any blogs worth reading and subscribing to with any of t...