javascript

Why firefox is written in C++ and javascript UI ?

Well..I am learning java now and I am curious to know will this yield a noticeable performance increase ? And If many developers are following similar methodology for windows programming ( C++ back end and Java UI ) or other languages are used like python? *this : C++ back end and other languages for UI instead of using the other langu...

Sharing rules between javascript and SQL

I'm mostly looking for ideas here. The odds of my group purchasing something to solve the problem is incredibly low, but go ahead and suggest any commercial products that would help. The basic problem stems from the following scenario: Users input data into a form, which auto-populates some values based on existing data. This data is...

How do I select string after a specific symbol in javascript/Jquery?

Let says I have a string that says and the cow went @moo, and I want to only select moo... how would I go about that? ...

Adding to a class' variables with elements in an object

$class = new Class; $foo = json_decode($_POST['array']); In this highly contrived example, I have a class with its own functions and variables, blah blah. I also just decoded a JSON string, so those values are now in$foo. How do I move the elements in $foo over to $class, so that: $foo->name becomes $class->name? Would be trivial if...

Change Background position onClick

I would like to change the background position of one link when another link is clicked. I want this to change: <a class="fast btn-slide" href="#"></a> ...

Is it OK to sometimes leave ~5% of the people "behind" / The Epic Javascript 'usability' debate: Episode #101.

I'm certain this has been asked before-in other ways-please bear with me (for a moment) while I proceed to pinpoint the exact question: (((Not intending to offend anyone))) 1) In general usability is truly important. 2) "Blind people" can't be airline pilots (for example), and people with an IQ of 47 may never be able to read a massiv...

How to get Google Search API results href values using jquery

Hello everyone. I am using the simple Google API to display search results. I would like to get the href value of a link on mouseover or click. It is really not important what flavor of javascript is used, I just need to get the user selected href value of the rendered search. (I need this as I have a webservice that allows users to sav...

jQuery event sequence ....

Hello, I have a main screen with 2 parts a list and a detail section. Via a button, I open a modal dialog. On this modal dialog, 2 buttons one for save and the other for cancel. After the save, I call a function to refresh the list on the main screen and close the dialog. The problem, sometimes, the list is refresh before the end of the...

Reference loops

I don't know how better to describe this. So take this example. var a = { x: 1, y: 2 }; var b = { z: 3, refA = a }; a.refB = b; I have a preference that this is sort of behavior is ugly. So at best, I have a personal disagreement with this sort of coding. You should not need to have these types of references, and it leads ...

Google maps and iPhone

I'm developing simple application for smart phones. It works everywhere except iPhone. Code is dead simple: js: var initial_lat = 58.3972; var initial_lng = 15.5776; var initial_zoom = 15; var map; function initialize_map() { var initialLatLng = new google.maps.LatLng(initial_lat, initial_lng); var myOptions = { zoo...

Javascript not recognizing Quicktime movie object

Hello i'm trying to play just the first few seconds on a quicktime movie then stop. if the user scrolls, I replay - Im doing this to reshow the image that seems to go away when scrolling. By design, once the user clicks 'Play' I want the movie to disregard the scroll (and other) functions. This seems to work in FF, but not in IE, where t...

Make JQuery follow 302 Redirect AJAX call in the same domain

Hi, I'm trying to access the API at http://boo-box.com/api/format:json/aff:mercadolivreid/uid:173091/tags:my-query/jsonp:callback. It works fine if I try to wget it, or from my browser. But if I try to do: function getProducts() { var query = encodeURIComponent(document.getElementById('query_input').value); url = 'http://boo-box.c...

Why does the jQuery JSON parser need double escaping for backslashes?

I have trouble wrapping my head around a peculiar feature of the JSON data format. The situation is as follows: I have a string containing a Windows (sigh) directory path, backslashes escaped. For some reason, the jQuery JSON parser thinks that a single escape is not enough. <script type="text/javascript" src="http://ajax.googleapis.co...

javascript: how do I pass safe strings to an array for client side display without messing it up / ASP.NET C#

platform: ASP.NET 3.5 / C# My requirement is this: I want to create a rather large array on the server side (in C#) and pass it to the browser via Page.ClientScript.RegisterArrayDeclaration("gBank", js); My array is a 2-dimension array, and I am constructing it right to pass it to the client. Simple cases work fine. My problem is ...

Rails 3 automatically adding X-UA-Compatible header?

Hi, Does Rails 3 automatically add a header if you are using IE8? I am seeing the meta tag for X-UA-Compatible set to "IE=8.0000" and it's messing up one of my views. I can't seem to find anything else that would be doing it, so figured I'd ask the brains here. Thanks, Ruprict ...

Get pathname from href in Javascript

Hi, whats the simplest way to return the "pathname" from an anchor tags href attribute? example... say I have: <a href="http://www.example.com/this/is/my/path.html"&gt;Blah&lt;/a&gt; I need to return only this "/this/is/my/path.html" part. Ideas? I'm using jQuery if it helps.. Thanks! ...

Dwr callback "data" object length

I'm using dwr to handle ajax calls to a java backend, I'm returning a Map in java, and I need to know its size in javascript when it returns in a callback function. Is there a way to do that? ...

A univsersal createPopup() replacement?

Currently createPopup() is only supported in IE (See http://help.dottoro.com/ljsxcrhv.php). Is there a univsersal createPopup() replacement? Or is conditional code required based on browser detection? Hopefully, I am looking for something that 1. not only provides the same functionality, but 2. has the same interface or at least cou...

Any way to toggle between two strings using one piece of JavaScript?

HI all I want to do something like if(something.val() == 'string1') { something.val('string2'); } else if(something.val() == 'string2') { something.val('string1') } But in one line of code. I can't quite remember how it's done, but it involves question marks and colons lol Sorry to be vague James ...

jQuery: How to queue a function to complete after an array of animations?

I am trying to animate a table row sliding up, then adding a new table row, and animate the new table row sliding down. I have read up on how to animate a table row, now I am trying to queue up these animations. <table> <tr> <td><div><a class="trigger" "href="#">Hide this row and add a row after this one</a></div></td> ...