javascript

GWT's JSONParser producing incorrect values for numbers.

I'm work with GWT and parsing a JSON result from an ASP.NET webservice method that returns a DataTable. I can parse the result into a JSONvalue/JSONObject just fine. The issue I'm having is that one my columns in a DECIMAL(20, 0) and the values that are getting parsed into JSON aren't exact. To demonstrate w/o the need for a WS call, in ...

Best way to incorporate javascript in php?

This is the way I am currently doing it. <?php //show footer echo "<script type='text/javascript'>\n"; echo "alert('Congrats');\n"; echo "</script>"; ?> Is there a better way than just to echo it? ...

Cakephp 1.3 JsHelper for AjaxHelper

Hi: I'm start using cakephp and i made a demo app using AjaxHelper $ajax->link('title', 'url', array('update' => 'mydiv')) Now i want to migrate that to cakephp 1.3 and AjaxHelper is deprecated on cake 1.3 and will be removed, so i want to accomplish the same with JsHelper which is replacing the functionality of AjaxHelper and Javascr...

I have one javascript error in my IE8.

"Object doesn't support this property or method" It's this line. pthumb = $("#pthumb").attr("src"); Does anyone know why? ...

Changing <img src="XXX" />, js event when new image has finished loading?

I have a photo gallery web page where a single <img src="XXX" /> element's src is changed (on a click) with javascript to show the next imagea poor man's ajax I guess. Works great on faster connections when the new image appears almost immediately. Even if it takes a few seconds to load, every browser I've tested it on keeps the old imag...

How can I sort an array, yet exclude certain elements (to be kept at the same position in the array)

This will be implemented in Javascript (jQuery) but I suppose the method could be used in any language. I have an array of items and I need to perform a sort. However there are some items in the array that have to be kept in the same position (same index). The array in question is build from a list of <li> elements and I'm using .data(...

Get the ID of the Current Textbox using JQuery

I have a form with 2 text boxes that all do the same thing. They each call the JQuery function below after each keypress. Since I have 2 textboxes that all do the same thing, I'd like this function to work for both. How do I change this function so that it'll grab the textbox's ID that is currently being edited instead of just the one...

User control javascript

Hi, I have a generic user control which will be used twice in a page. There is a javascript asscoiated with it which also needs to be added. How can I add this to a page since the javascript will be added multiple times. ...

Small, Custom WYSIWYG editor

I would make to make a small WYSIWYG editor similar to the one used by StackOverflow. Basically, it would have buttons like [quote], and when that button is clicked, [quote] [/quote] should be inserted in the textarea where the cursor is or at the end of all other text. If the [quote][/quote] could be highlighted in some way that would b...

RSS-reader in Ajax: Help with code, what's wrong/missing?

Hi! I'm learning Ajax currently, and I use "Sams Teach Yourself Ajax in 10 minutes". I've learnt much, and understand Ajax basically. The book writes code-examples and go through the code bit by bit to explain what each bit does. However. In this code there is something wrong written by the author, and I don't know what.. Here is the co...

How can I select a range of td's in a table with javascript area selection?

Hello all, I looking for a script that will enable me to select an area in a table (using the mouse), something similar to this script - http://odyniec.net/projects/imgareaselect/. What I need to do is to select some td's with an identical area effect as used in the imgareaselect above, and manipulate the containing data. Any ideas? ...

HTML, XHTML, and CSS... what are some good resources?

What's a good book, or a good way to learn HTML, XHTML, and CSS? I recently graduated from school and I only know Java, and C++. I would like to learn some web development so I am looking for some good books and resources. ...

How to stream megaupload videos using divx?

I have seen some websites stream avi videos from megaupload using divx web player. How would I do this for my site? Are there open source scripts to do this? How would I get started? ...

jQuery click behaviour

I'm developing a menu. This menu, will change the background image when you click on a link, as almost all menus do. If I click in one link from the menu, this link background will change the color. My jQuery script is: $(function() { $('#menu ul li').click(function() { $('#menu ul li').removeClass("current_page_item"); $(this).a...

Create a permalink with JavaScript

I have a textbox where a user puts a string like this: "hello world! I think that __i__ am awesome (yes I am!)" I need to create a correct URL like this: hello-world-i-think-that-i-am-awesome-yes-i-am How can it be done using regular expressions? Also, is it possible to do it with Greek (for example)? "Γεια σου κόσμε" turns to ...

What's the best way to offer javascript embed that won't slow a page down?

I have a chunk of javascript that users can copy and paste to put on their sites. I'm currently using the following code (ala WEDJE) that allows the rest of the page to load even if my script is slow or not responding. <script type="text/javascript"> var number = "987654321"; var key = "123abc"; (function(){ document.write('...

openDatabase Hello World

I'm trying to learn about openDatabase, and I think I'm getting it to INSERT INTO TABLE1, but I can't verify that the SELECT * FROM TABLE1 is working. <html> <head> <script src="http://www.google.com/jsapi"&gt;&lt;/script&gt; <script type="text/javascript"> google.load("jquery", "1"); </script> <script type="text/javascript"> var db; $...

Remote Scripting in Opera handheld widget

I have to do a widget that calls functions from a remote javascript file, my problem is that i dont know how configure that in config.xml. ...

Destructuring assignment in generator expressions and array comprehensions

Why does for ([] in object); work fine but [void 0 for ([] in object)] or (void 0 for ([] in object)) throw a syntax error for invalid left-hand assignment? For example, I would expect the following code to work, but it doesn't (the assertion isn't even done due to the syntax error): let ( i = 0, arr = [1, 2, 3, 4], iterable = {_...

How to embed functionality into HTML email?

We want to let users click a thumbs up or thumbs down button from an HTML email, without causing the clicking to open a browser window. Is there a way to essentially embed limited web functionality (i.e., clicking an icon, showing confirmation) within HTML emails? Thanks! ...