Hi,
Is there a way to generate sequence of characters or numbers in javascript?
For example, I want to create array that contains eight 1s. I can do it with for loop, but wondering whether there is a jQuery library or javascript function that can do it for me?
Thank you
...
Hi,
I have been working on this for 1 hour with no such luck. Any help would be appreciated.
I have a cgi script with which creates these select param values:
print "Please select a dkversion to compare : <br><br>";
print "<select name='dkversion' id='dkversion' size='6' multiple='multiple'>";
foreach my $values ('ASDF123GS v0.01 mod...
I have a point where a Gpolyline line is drawn from a marker to another point. After I click on it a second time, I want to remove the polyline. How do I remove the line after clicking on the marker a second time?
My pseudo-code is as follows:
google.maps.event.addListener(markersArray[0], 'click', function() {
'draw line to po...
I declare my javascript in the design page of a usercontrol (ascx). Is there a way to register this javascript block in the Head section? I don't want to use ClientScript.RegisterClientScriptBlock as I don't want to declare my javascript in the code-behind. I also cannot move it (entirely) into a separate file, because I use business log...
$(window).load(function() {
var paircount = 0;
var $thisSprite = $("#%id% img.imageStyle");
if ($.browser.msie)
{
// I need this only if desaturate png with aplha channel
$thisSprite = $thisSprite.desaturateImgFix();
}
// modified not to desaturate the clone
$thi...
In Javascript, how can I use a regular expression to iterate through a string to isolate all occurances of strings starting with a '{' and ending with a '}' character?
So, for example the haystack string may be:
Lorem ipsum dolor {sit} amet, consectetur adipiscing elit. {Praesent} tincidunt, sapien non ultricies posuere, justo felis {p...
We have JavaScript that writes to the document title and attempts to pad it with extra spaces...
document.title = "My Title "
But this gets translated to "My Title&nbsp;&nbsp;"
Anyone know how to prevent this?
...
Trying to clean up some code. I have a button that has the following inline JS
<input id="lookup" type="submit" name="lookup" value="Search" onclick="changestart('1')" />
I would like to change the onclick to a jQuery click funnction but am getting no success. Here is the "changestart" function
function changestart(direction) {
v...
I have this functions
//send JSON-RPC request
var json_rpc = (function() {
var id = 1;
return function(url, method, params, success) {
if (typeOf(params) != 'array') {
params = [params];
}
var request = JSON.stringify({
'jsonrpc': '2.0',
'method':...
What would be the easiest way to transform
$('#my_element').css('backgroundColor')
to object like this:
{ r: red_value, g: green_value, b: blue_value, a: alpha_value }
?
...
Hi guys.
I'm trying to figure out with this isn't working.
It used to take care of height instead of width, but i simply can't get it it work.
Anyone could point me in the right direction of the problem perhaps?
function getWindowWidth() {
var windowWidth = 0;
if (typeof(window.innerWidth) == 'number') {
...
here is my countdown
$('span.countdown').each(function() {
var endtime = $(this).html();
$(this).countdown({
until: endtime,
format: 'dhmS',
layout: '{d<}{dn} days {d>}{h<}{hn} hours {h>}{m<}{mn} mins {m>}{sn} secs',
expiryUrl: self.location.href
});
});
}
i ...
To prevent the default scrolling of a page I'm adding an event listener for "touchstart" events on the body and calling event.preventDefault() This works fine but I now can't access the debug console as it requires a page drag? Has anyone else had this problem and come up with a work around?
...
I've created DIV.cb-toggle, when the user hovers over this div, it animates to Orange, when they hover off of this div, it animates back to gray, when the user clicks this div, it animates to blue, telling the user that it's been selected. So when it's NOT selected, it has mouseenter mouseleave animations, but when it's selected i want ...
Hi,
I am not able to make my jgrid text box draggable. How can I make it draggable?
Please help.
Here is my code.
jQuery(document).ready( function() {
//debugger;
var lastsel3;
jQuery("#test").jqGrid({
url:'/Content/xml/user.xml',
//url: $!retrivexml,
datatype: "xml",
colNames:['Consultant','Project R...
Hi.
I need to do the following, but I couldn't find any example of similar form validation on the web:
<script type="text/javascript">
function something(){
if the value on the field who is calling this function == 2,4,6 or 8
alert("This number is invalid")
focus in this field.
</script>
Field1 call something()
Fi...
Is there any javascript framework for reporting bugs?
I'd like to be able to get a copy of the web page the user is currently looking at plus maybe a stack trace on the JS, their current browser etc. and post it to my web application so that when I try to debug the application I spend less time trying to recreate the issue.
...
Facebook: How to build a basic app inside FB with iframe, javascript, and Graph API
I've previously built an FB app with FBML and PHP, but everything feels so different with the new way they're doing authentication and everything.
There's no "Building Apps the New Way 101" guide either that I can find.
How do you build a classic FB ap...
Hi,
I have web form with multiple submit buttons. To determine which button was pressed, each has a different name, like so:
<input type="submit" name="foo" value="Foo Foo">
On the form there are also normal links that act as submit buttons, like so:
<a href="" onclick="parentNode.submit();return false;">
Bar
</a>
My question is h...
this is my simple code I'm using in a test page: but it takes ages to find the address...how come? am i doing something wrong?
<script src="http://maps.google.com/maps?hl=it&amp;file=api&amp;v=2&amp;sensor=true&amp;key=*xxxxxx*" type="text/javascript"></script>
<script type="text/javascript">
var map;
var geocode...