javascript

slideDown() makes everything in wrapper shift

Hello everyone, I am currently creating a simple menu where there are several names of services and a user can click on one and jQuery will show it's corresponding paragraph describing it below it. My jQuery code is fine and does exactly what I want, however, I have one bug I have yet to iron out. Whenever I click one of these headings ...

Set selection in Dashcode List Controller

I have a list controller in my Dashcode project, it pulls its data from a dynamic source. After my list controller has loaded its data I'd like to set it's selected index to 0 - so that information for the first item in the list is shown. I can't for the life of me figure out how to do this. I've tried: function load() { dashcode.s...

.each or search function, how can I make use of those?

I have a ul list, with 10 items, and I have a label that displays the selected li text. When I click a button, I need to check the label, versus all the list items to find the matching one, when it finds that I need to assign the corresponding number. I.e. list: Messi Cristiano Zlatan hidden values of list items: www.messi.com www.cr...

What are the rules for cross-domain AJAX requests for dynamic local content?

If I'm using a .NET WebBrowser control, and I dynamically populate the HTML, JS content, what exactly are the rules for AJAX cross-domain requests? I know I don't technically have a domain since it's local content, but I'm not sure how the browser handles this. ...

XMLHttpRequest leak

Hi everyone, Below is my javascript code snippet. Its not running as expected, please help me with this. <script type="text/javascript"> function getCurrentLocation() { console.log("inside location"); navigator.geolocation.getCurrentPosition(function(position) { insert_coord(new google.maps.LatLng(position.coords...

Is it reasonable to start using Google Maps for Flash rather than Javascript version?

I am planning to build a web application highly based on Google Maps API. I am considering either using the Javascript version, or the Flash version. I would like to create an interface which will be quite rich. Should I go for JS version of the API or Flash one? Also I do not plan to purchase Flex Builder, so ideally I would like to use...

How to manipulate JavaScript

Hello, I was wondering if there was any way to manipulate JavaScript execution on predetermined action on a certain website. Thus meaning if there will be an action on mouse hover, is there a way to bypass the Javascript execution? Thank you on your time, bojanski ...

Designing a fluent Javascript interface to abstract away the asynchronous nature of AJAX

How would I design an API to hide the asynchronous nature of AJAX and HTTP requests, or basically delay it to provide a fluent interface. To show an example from Twitter's new Anywhere API: // get @ded's first 20 statuses, filter only the tweets that // mention photography, and render each into an HTML element T.User.find('ded').timelin...

javascript .push() doesn't seem to work

I am trying to use .push to put items into a javascript array. I have created a simplified piece of code. When I click the button with id clickButton, I am expecting to get a series of alerts with numbers, but I get nothing. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transition...

javascript binding

MyObj = { ajax: null, init: function() { this.ajax = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"] .createInstance(); this.ajax.onload = function() { return function() {this.onload.apply(this, [null]);} }; }, onload: function () { Reader.log("I really...

Connecting C++ backend to Javascript

I was hoping to make a website that displays a google map with points based of information returned by a C++ function. I know you can use Java Server Pages to call java methods on the server with javascript. Would there be a way to connect C++ code on the server with javascript in order to produce the same result as java server pages? ...

How can I make a link open in a new window using css?

I need to make a set of links open in a new window - the good thing is they all have the same css style - what do i need to do in css to get these links opened in new window? ...

I'm using Jquery countdown for a timer

I need the form to be submitted at the end of the count down. I am aware of expiryURL, but the form doesnt get processed. Can someone help? Thanks! ...

JavaScript: Given an offset and substring length in an HTML string, what is the parent node?

My current project requires locating an array of strings within an element's text content, then wrapping those matching strings in <a> elements using JavaScript (requirements simplified here for clarity). I need to avoid jQuery if at all possible - at least including the full library. For example, given this block of HTML: <div> <p>T...

Iterating over two arrays at a time in Javascript

I want to iterate over two arrays at the same time, as the values for any given index i in array A corresponds to the value in array B. I am currently using this code, and getting 'undefined' when I call alert(queryPredicates[i]) or alert(queryObjects[i]), I know my array is populated as I print out the array prior to calling this, I ha...

How to split a string in combo block quota EX: [ text ] in jQuery

Hi everyone! i'm a newbie in jQuery and i don't know how to do my homework, pls help me ! i have a String EX: this is my text, press here. Now i put in o block character : [here] how can a take slipt string and get text in [ ] into variable 'done'? thankyou ! my HTML here: <div id="quotacontain"> <p>this is demo [ string ]</p...

Why am I getting this error?

function changeSize( fontsize ) { var body = document.getElementById("body"); var font = fontsize + "-font"; body.className = font; } <input type="button" onclick="changeSize(small)" value="Small" /> Firefox console keeps saying that small is undefined. What am I doing wrong? ...

.getScript getting the redirect url of javascript

I d like to execute a remote javascript which redirects the user to another page on my domain with data that s passes as query string. I want to get this data which is passed on to the page on my domain. $.getScript('http://site.com/foo.js', function() { //foo.js redirects to another page on my domain with data ...

Returning JSON from JavaScript to Python

I'm writing a simple App Engine app. I have a simple page that allows a user to move a marker on a Google map instance. Each time the user drops the marker, I want to return the long/lat to my Python app. function initialize() { ... // Init map var marker = new GMarker(center, {draggable: true}); GEvent.addListener(marker, "dra...

Confused on the basics of AJAX

So right now, I'm just using a basic form to check a password. I want it to check the password and basically remain on page.html so I can use JavaScript to alert incorrect password or something. I'm not really sure how to do that. It seems it would bring me to check.php. I'm not too sure on the whole process, any help appreciated! Thanks...