I need to find all substrings from a string that starting with a given string following with a left bracket and then any legal literal and then the right bracket. For example, a string is abcd(xyz)efcd(opq), I want to a function that returns "cd(xyz)" and "cd(opq)". I wrote a regular expression, but it returns only cd( and cd(...
...
I am creating an app using the Bespin editor and HTML5's localStorage. It stores all files locally and helps with grammar, uses JSLint and some other parsers for CSS and HTML to aid the user.
I want to calculate how much of the localStorage limit has been used and how much there actually is. Is this possible today? I was thinking for no...
I need to achieve something like this for my website: Flash Rain Effect
Is that possible to do in Javascript? I want it to be just as smooth as it is in Flash.
Another flash rain drop water effect
...
I have an option for people to store an embed link to Vimeo or YouTube as part of their profile. I'm storing it in an embed_link:string in my DB. What do I need to be careful of so people only post those links and not dangerous javascript or anything else?
...
Can anyone explain the following code? Forget the sine and cosine parts. Is it trying to build a space for the object?
objectsInScene = new Array();
for (var i=space; i<180; i+=space) {
for (var angle=0; angle<360; angle+=space) {
var object = {};
var x = Math.sin(radian*i)*radius;
object.x = Math.cos(angle*radian)*x...
I did a lot of searching for what I thought would be a pretty common question, but I came up with nothing. If there is another thread with a similar topic, please let me know.
Basically, I'm looking for a way to have an .mp3 file play in a website without relying on a flash-based player. I've searched w3 schools and every forum I can th...
Say you have a string: "The ABC cow jumped over XYZ the moon" and you want to use jQuery to get the substring between the "ABC" and "XYZ", how would you do this? The substring should be "cow jumped over". Many thanks!
...
I am developing a firefox extension and create a table and in it add a image , and I create a image with :
var _img = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "xul:image");
and then I found I couldn't set its attribute "src" with a local image just like use its Url: chrome:\...., so I ha...
How do I get the values in between a DIV tag?
Example
<div id="myOutput" class="wmd-output">
<pre><code><p>hello world!</p></code></pre>
</div>
my output values I should get is
<pre><code><p>hello world!</p></pre>
...
How do I call php variables or queries in JavaScript?
...
Ok, there seems to be a problem with the JS Code for Opera browsers, as it only removes the last option tag that is selected within a multiple select tag, can someone please help me.
Here is the HTML for this:
<select id="actions_list" name="layouts" multiple style="height: 128px; width: 300px;">
<option value="forum">forum</option...
I want to display the browsed time of a user, But when i refresh it, it will be again start from 0:0:0.
How can it handle?
<?php
$total_mints=($live_match['match_name']) * (60);
?>
<script language="javascript">
display_c(<?=$total_mints?>,'ct');
</script>
<script type="text/javascript">
function display_c(start,div){
window.start ...
I use the following function to add a crosshair to my Google Map. It works great for horizontal resizing. I can not figure out how to make it work for vertical. After resizing the map it requires the user to either zoom in or out 1 layer, upon which the crosshair snaps to center.
var crosshairsSize=17;
GMap2.prototype.addCrosshairs=f...
I am doing pagination in javascript. This is typographic pagination, not chopping up database results. For the most part it works, but I have run into a heisenberg issue where I cannot quite measure text without affecting it.
I am not trying to measure text before it is rendered. I want the actual position it shows up at on screen, s...
Is there a way to add custom fields to the built in browser context menu using Javascript?
I know flash/actionscript can do this, how are they doing it? Example: right click on http://josephjewell.com and see the custom context menu.
Is this possible with pure javascript or do you have to use flash?
Note, I'm looking for adding to th...
i have the following lines of html code -
<div class="twitters" id="cbd">
<p><a href="javascript:;" onClick="tweeet('<?php echo $c; ?>')">My Tweets!</a></p>
</div>
Now what i need to do is call the tweet() javascript function without any link being clicked or any button being clicked . i.e this function is called on...
I tried to use the parse() function of JSLint to parse three pieces of JavaScript code:
function(b, c){var a = b + c; return a; }
window.addEventListener('click', click_hanlder, true);
document.documentElement.innerHTML;
The output:
returns a correct tree.
returns a tree with only one node of "window".
crashes the browser.
I'm wo...
i am using modalpopup to enter some value in a textfield. after the value is selected in the modalpopup view, the modalpopup is closed and the value has taken the propriate value. Even if the value is displyed in the textfield, the textfield1.text returns me string empty. when i see the source code (html), i see that even that the textfi...
I have a custom info window over a google map, sometimes these info windows contain an image. When they do, the info window scales down over the marker it is positioned over as soon as the image has finished loading.
So the images take longer to load and the div's position has already been calculated by the time the image is finished lo...
Just wondering if it's possible to print and list all methods and attributes available to the DOM document itself using Javascript?
So I would get something like so:
Document.doctype
Document.implementation
Document.documentElement
Document.createElement
Document.createDocumentFragment
Document.createTextNode
Document.createComment
Doc...