I have a singleton object that use another object (not singleton), to require some info to server:
var singleton = (function(){
/*_private properties*/
var myRequestManager = new RequestManager(params,
//callbacks
function(){
previewRender(response);
},
function(){
previewError();
}
);
/*_pu...
I have an issue regarding to auto populating a select dropdown from jQuery/JSON data which is return from a ColdFusion CFC, the code is below:
$(function(){
$("#licences-add").dialog({autoOpen:false,modal:true,title:'Add Licences',height:250,width:380});
});
function openAddLicence(intInstanceID,szName,szDatasourceName){
$.getJSON('/...
Hi
I have a javascript variable containing escaped HTML. There can be script tags inside the HTML, like this:
var valueToInsert = "%3Cscript%20type%3D%22text/javascript%22%3Ealert%28%27test%27%29%3B%3C/script%3E%0A%3Cscript%20type%3D%22text/javascript%22%20src%3D%22http%3A//devserver/testinclude.js%22%3E%3C/script%3E%0A%3Cimg%20src%3D%...
I have found this code for reverse geocoding:
var point = new GLatLng (lat[1],long[1]);
var geocoder = new GClientGeocoder();
geocoder.getLocations (point, function(result) { alert (lat[1]+' '+long[1]+' '+result.address); });
But it pops the alert, saying that result.address is 'undefined'. Any ideas, what could be the problem?
EDI...
Hi,
I have a requirement to replace the text between () in a string.
...
Im not sure how to output MySQL data into formats below. (eg: timelist, usersex, userage from table users.)
<script type="text/javascript">
timeList = new Array(),
userSex = new Array('female','male','male'),
userAge = new Array('21','36'),
userMid = new Array('liuple','anhu');
</script>
Thanks!
...
How do you handle templating HTML and JSON without locking the HTML into javascript strings?
I have an ajax-enabled site that presents a lot of dynamic content by interpolating JSON values with HTML. This all works fine.
BUT it means I have significant amounts of HTML all through my JavaScript.
For example:
var template = "<div>Foo:...
I'm not sure what is causing this, but I am using cluetip and binding it to a live event (either click or mouseenter), but in each situation the cluetip isn't firing until after one click or hover event. I am using the live event for ajax loaded content, but I'm also having this issue with non-Ajax loaded content. I'm not sure why this i...
is it possible to show/hid a div on a webpage if say three keys are pressed in the correct order on a normal keyboard....
Im trying to hide my login div in drupal and only want it to show if I press say three keys on the keyboard. Dosnt matter if it shows up in source.
any thoughts/links?
cheers
...
If I'm going to learn programming first time, How i should start?
I don't know programming yet but I'm good at XHTML and CSS. my main aim is to learn first Javascript than second PHP. after having good command in Javascript I'll move to PHP.
all these i want to learn to get good command in all areas of Wordpress design and Development...
I've been asked to develop a system wherein employees can mark on a form their availability on a given day of the week - for instance an employee could mark themselves as available on a given time on a given week, and unavailable on some other time. It looks a little like this:
Currently this works by rendering checkboxes within the t...
Hello all,
I have a JavaScript variable that I echo out using PHP which is shown like this in the page source:
var db_1 = 'C:\this\path';
When I set the value of a text field with that variable like so:
$('#myinput').val(db_1);
The slashes have disappeared and only the other characters are left!
Why is this and how can I put the ...
Hello Guys,
I am unable to convert JSON string to .net object in asp.net. I am sending JSON string from client to server using hidden field (by keeping the JSON object.Tostring() in hidden field and reading the hidden field value in code behind file)
Json string/ Object:
[[{"OfferId":"1","OrderValue":"11","HostingTypeID":"3"},
{"Offe...
I'm trying to create an image rotator class that cycles through an arbitrary number of images in an unordered list. Is it possible to define a recursive function within a class declaration? E.g:
var Rotator = Class.create() {
initialize: function() {
do something...
this.rotate();
}
rotate: function() {
do something...
t...
My javascript isnt so great, but i found a brilliant looking function here
I'm not sure what to do with this bit:
var ranges = [], rstart, rend;
full function:
function getRanges(array) {
var ranges = [], rstart, rend;
for (var i = 0; i < array.length; i++) {
rstart = array[i];
rend = rstart;
while (array[i + 1] - ar...
I have a page and clicked on the button there it will open a new page containing some text boxes, user fill all the text boxes and clicked the button now first page open again and the question is : How can I get the vales of text boxes on the current page using both server-side and client-side
There is a restrictions to use of :
- Cros...
If I have a certain code, How do I traverse or get to the button(i.e type == INPUT) in JavaScript.
<td> <div>
<script></script>
<script></script>
<script></script>
<input type="button"....../>
</div></td>
I tried doing:
var cell = row.cells[0];
if (cell) {
var btn1 = cell.firstChild;
alert(btn.tagName.toUpperCase...
Hi,
I am using the jQuery autocomplete plugin for a smart input box. I want the first parameter in the input box to be autocompleted from one dataset, then once that has been selected change the dataset for the second parameter.
So if I have the following:
var foo = ['a','b','c'];
var bar = ['x','y','z'];
$("#input_box")....
I am dynamically creating divs within a jquery accordion that are loaded with data as when the user clicks on the accordion title. I have this all working except that when I pass the div id into the load details method, the call to .load() does not work. What can I do to fix this? It seems like a simple javascript string eval would work ...
I've been testing out the new functionality of html5 and js to create a sketching site. I've been looking into this for a possible client that wants their site to be ipad accessible, but also have drawing features on it.
So i created a rough experiment where you can drag your mouse across a screen to draw lines. I went to test it on an ...