javascript

parse a character out of a string in javascript

if i have a number of string like this var info = "Information4Table" var next = "Joe5Table" var four = "ERweer11Table" var nice = "ertertertn14Table" and i want to parse out the number between the first word and the string "Table". So for the first item, i want to get "4" and in the last i would want to get "14". what would be the ...

document.write in status bar

I'm trying to create my own bookmarklet, and there aren't exactly a huge number of guides for doing so. Basically, right now I'm trying to figure out why I can't just do javascript:document.write("HAI, WORLD"), which has the unintended effect of replacing the window contents. It's my understanding from elsewhere that Javascript replaces...

Google Maps API v3 - IP-based Geolocation

Has anyone been able to get geo-location based on a person's IP to work using Google Maps API v3 JavaScript? It seems to me that even the google provided example doesn't work. http://gmaps-samples-v3.googlecode.com/svn/trunk/commonloader/clientlocation.html Question: Does this example work for anyone? How do I get geolocation based ...

what is the encoding of this string,'base64' or 'utf-8'??? ,how can i get it readable.

print "4-12\u4e2a\u82f1\u6587\u5b57\u6bcd\u3001\u6570\u5b57\u548c\u4e0b\u5212\u7ebf".decode('base64')#no thanks and if i have '4-12个英文字母、数字和下划线' how can i get the string '4-12\u4e2a\u82f1\u6587\u5b57\u6bcd\u3001\u6570\u5b57\u548c\u4e0b\u5212\u7ebf' is print '4-12个英文字母、数字和下划线'.decode('what')# i write: print u'4-12个英文字母、数字和下划线...

PHP variable as part of a jQuery function doesn't work, but plain text does

I have the following jQuery code in my PHP file (edited Jan 19 2010 @ 10:40 MST): <?php $count = 0; foreach($attachments as $attachment) : echo '<script type="text/javascript"> $(\'#a_'.$count.'\').click(function() { $(\'#d_'.$count.'\').show(200); }); // if "no...

How to get the swf object from within a web page?

Suppose the swf file is embeded into the page with the following code: <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="myFlash" width="600" height="500"> <param name="movie" value="myMovie.swf"> <embed type="application/x-shockwave-flash" src="myMovie.swf" name="myFlash" width="600" height="500" > </embed> </ob...

jquery won't work in multi level dependency?

$(document).ready(function() { $("#ddlprod").change(function() { var pk= $("#ddlprod").val(); $.ajax({ url: "ajaxprintdropdown.php", type: "POST", data: 'pk='+pk, timeout: 5000, success: function(output) { $('#divtesting').show...

Google Maps API - LocalSearch data results

Hello, I am using the LocalSearch control in my Google Map API. Here is a link to an example of what I have so far: http://code.google.com/apis/ajax/playground/?exp=maps#map_control_localsearch Now, I would like to "grab" each result from the LocalSearch when ever I click on a item. So if my search returned 2 results, I would like to g...

dynamic color change using javascript

hi everyone, can anyone pls give sugessions or ideas on how to write the script for selecting a color in a live page so that the selected color should apply to whole page.thanks in advance. ...

jQuery: Using a single Ajax call, receive progressive statuses instead of one single response?

Hi, I'm just wondering..is it possible to receive multiple responses from a single ajax call? I'm thinking purely for aesthetic purposes to update the status on the client side. I have a single ajax method that's called on form submit $.ajax({ url: 'ajax-process.php', data: data, dataType: 'json', type: 'post', success: func...

Custom scripts and styles for widgets in Symfony: position

My sample widget: class myWidget extends sfWidgetFormTextarea{ public function getJavascripts(){ return array('my_widget.js'); } public function getStylesheets(){ return array('my_widget.css'); } } Form template: <?php include_javascripts_for_form($form) ?> <?php include_stylesheets_for_form($form) ?>...

Javascript to check req fields on button click

Good day, I urgently need help. I need to check all fields have values on click of button. The button already has a command but i need to check / run through the page for required fields. On find a blank required field then display message else continue with button next command. If possible, maybe something that continues check on ...

Sequential web service call not working.

Hi , A little (!) bit of background before I can get to the question : I am implementing a web based search solution. Technology used: javascript (jquery), .net, html etc. etc. All my web service calls are done through javascript (cross domain ws call). I have few sequential web service calls which all have different success callback...

javascript anchor avoid scroll to top on click

I created a function in javascript that i add to an anchor as such javascript : somefunction = function () {alert('foo')} html : <a href="#" onclick="return somefunction()">anchor</a> everytime i click on the anchor the function executes but the screen scrolls to the top I know i could do this <a href="javascript:void(0)" oncl...

list some good javascript editors

tell some best and simple editor names like (FCK editor , WMD editor) (For inside textare field) ...

How can I get this string readable?

How can I get the following string readable? var sc = unescape(" %u9090%u19eb%u4b5b%u3390%u90c9%u7b80%ue901%u0175%u66c3%u7bb9%u8004%u0b34%ue2d8%uebfa%ue805 %uffe2%uffff%u3931%ud8db%u87d8%u79bc%ud8e8%ud8d8%u9853%u53d4%uc4a8%u5375%ud0b0%u2f53%ud7b2 %u3081%udb59%ud8d8%u3a48%ub020%ueaeb%ud8d8%u8db0%ubdab%u8caa%u9e53%u30d4%uda37%ud8d8%...

How to encode image data within an HTML file?

I'd like to be able to output an HTML file which includes an image (within the file itself). By Googling, I've come across a couple of ways to do this: javascript:imageData a data URI such as <IMG SRC="data:image/gif;base64,[...]"> <object ... > tag (although this uses a data URI, so may inherit the same limitations) But I don't know...

What am I doing wrong on this simple Closure

Hi all, it maybe sleep deprivation but I cannot understand why this isn't working. I want the onclick to return the value of i from a for loop that created the element and applied the event handler. Have put it in a closure and it is still turning the max number of the iterator. window.onload = function(){ var arbitrary_amount = 100; ...

struts: firefox ahref # symbol causes setter not to be called.

Monring all, It early Monday morning and I'm struggling to understand why the followng line works in IE and not in FF. <a class="button" href="#" onclick="setMaintenanceMode(false);">disable</a> In both IE and FF the URL when you hover over the button is... http://localhost:8080/mainapp/secure/gotoDevice.action?hardwareId=1&amp;stor...

How to addClass as per the link content?

I have one content page where there are links to different documents like .doc, .docx, .ppt .pptx, .txt. I want to apply/add class dynamically not manual. like as per the link content. <h3><a href="document.pdf" class="pdf-file">Document.pdf</a></h3> .pdf-file { background:url(../images/pdf-file.png) right center no-repeat; padding-rig...