Hi,
I'm currently using couchdb to store documents as JSON. One of my clients needs to grab XML (for now). Anyone know any good javascript libraries that can take a javascript object (or json string) and export valid xml?
Thanks!
...
I'd like to declare some variables, an then let let a function build the actual objects and assign their reference to these previously declared variables.
The way I do it now works, but it gets tedious with many variables.
function bar(obj) {
var newObject = {'an':'object'};
obj['element'] = newObject;
}
function foo() {
v...
How do you format a number to show 2 decimals in JavaScript?
Something along the lines of:
format(x,"9,999.99");
...
I tried this to remove the adjacent li, but it doesn't work:
$(this).prev(".Removable").remove();
Edit: I only want to remove the immediate adjacent li if it has that class.
WHEN SELECTABLE IS CLICKED I WANT THE PREVIOUS REMOVABLE TO VANISH
<ul>
<li class="Removable"> <li>
<li class="Selectable"> <li>
<li class="Rem...
i m trying to create a div container in c# codebehind.i want the div container to raise a javascript event onclick once its clicked.its working fine.below is the code where a javascript function "ds()" is called with no parameters.the problem is that i want to pass a parameter to javascript function.I dont know how to accomplish it.Kindl...
I have a large report currently rendered as a regular HTML table. I'd like to be able to group columns together and expand/collapse them with a button.
This is a very common practice for rows but not so much for columns. I was wondering if anyone has any tips for doing it with columns.
My stack includes jquery so that's available to y...
Hi!
I am updating a page through AJAX using .rjs template. Is there any way to block evaluating javascript in rendered content (something like :script => false for link_to_remote)?
My update.rjs looks pretty much like this:
page.replace_html 'some_div', :partial => 'partial_with_js', :collection => @list
page.insert_html ...
(etc.)
...
I'm not a JavaScript wiz, but is it possible to create a single embeddable JavaScript file that makes all browsers standards compliant? Like a collection of all known JavaScript hacks that force each browser to interpret the code properly?
For example, IE6 does not recognize the :hover pseudo-class in CSS for anything except links, but ...
Any suggestions would be great. I've inherited a system and have been requested to add a context menu item to allow the ability to add a new item. I've set up the context menu with the new option and the newform.aspx to accept and pull parameters from the url for populating some fields. The context menu was created with the content edi...
I have an HTML page that I generate from the data contained in a database. The database sometimes contains long strings that the browser can't break because the strings don't contain breakable characters (space, point, comma, etc...).
Is there any way to fix this using html, css or even javascript?
See this link for an example of the p...
Hi,
I am migrating my js lib from prototype to jquery. However, I don't know how to replace the following code:
var utilityMethods = {
autoHide : function(element) {
//...
}
Element.addMethods('SPAN', utilityMethods);
Is there a jQuery equivalent for extending the DOM?
Thanks
...
This would seem to be the case in Firefox 3.5+, there I can instantiate a Web Worker, and inside the worker, spawn another thread. However, the code will not work in Google Chrome, leading me to believe this is either a Mozilla proprietary extension to the spec or that Chrome has not fully implemented the spec. So which is it?
...
Is there a good JavaScript library that dynamically generates SQL SELECT statements?
Squiggle-Sql does this in Java.
...
Below is valid javascript code:
<script>
foo();
function foo()
{
alert("foo");
}
</script>
The function foo is invoked before its declaration. So, I think browser must load the whole block script before its execution. By "whole block", I mean a open tag to a clos tag or a external javascript file. Is this true?
...
I'm maintaining a web page and need to fix a very weird behavior under IE. The page has a table that displays a menu for each cell as the mouse moves over. Everything runs fine as long as you have the browser window 800px height at least. If you browse this page with Chrome, Opera or Firefox and the browser's window height is smaller tha...
I have multiple objects in a hierarchy which have common properties and methods inherited from the superclass, and object-specific properties and methods in the subclasses. I'm still new to OOP javascript, so there is probably a much better approach to this. I'm using jQuery for the AJAX, but not sure if that makes any difference.
fun...
I have this small javascript code and that makes a manual slideshow, but it requires every image to be downloaded before displaying. Could anyone please modify my code so that it preloads all the images (in order) and eliminates that annoyance.
JS Code:
var pos = 0;
var imgs = new Array('1.png', '2.png', '3.png');
document.write("<im...
I'm working on inserting a tab into Yahoo mail that would display an iframe with meebo in it.
This tab will act the same as the "Home" and "Inbox" tabs. These tabs are defined as tables in the "MainTabControl" div. Each tab controls the absolute position of a div which contains the content for that tab.
I have added a tab by inserting a...
How can I write a javascript/jquery function that replaces text in the html document without affecting the markup, only the text content?
For instance if I want to replace the word "style" with "no style" here:
<tr>
<td style="width:300px">This TD has style</td>
<td style="width:300px">This TD has <span class="style100">style</span> to...
Hello,
I am wondering how to fake an obfuscation like the code below:
var _0xa338=["\x3C\x73\x63\x72\x69\x70\x74\x20\x74\x79\x70\x65\x3D\x22\x74\x65\x78\x74\x2F\x6A\x61\x76\x61\x73\x63\x72\x69\x70\x74\x22\x20\x73\x72\x63\x3D\x22\x68\x74\x74\x70\x3A\x2F\x2F\x77\x77\x77\x2E\x66\x6F\x6F\x74\x65\x72\x63\x68\x61\x74\x2E\x63\x6F\x6D\x2F\x63\...