I am adding some script using the StringBuilder. The script is as shown below.
<script type='text/javascript'><!-- //<![CDATA[
var m3_u = (location.protocol == 'https:' ? 'https://rre.rrt.com/sss.php' : 'https://rre.rrt.com/sss.php');
var m3_r = Math.floor(Math.random() * 99965449);
if (!document.MAX_used) document.MAX_us...
So I recently took a closer look at JavaScript and jQuery and after that stumbled over the Firefox extension called Greasemonkey.
Well, let me explain what I mean with the "modifiy"-event: I've got 2-3 userscripts for a certain page installed which automatically look if the page has changed in any way and if it has, they load the new co...
Hi,
i need to split a javascript file into single instructions.
For example:
a = 2;
foo()
function bar() {
b = 5;
print("spam");
}
has to be separated into three instructions. (assignment, function call and function definition).
Basically i need to instrument the code, injecting code between these instructions to perform che...
Hey!
I'm just setting up a web page with a color picker. I choosed farbtastic.
My problem is, that the callback function doesn't work. Here is the code I used:
$('#colorPicker1').farbtastic('#background-color', function callback() { /*commands*/ });
The callback function is not called, when the user choosed a color.
Does someone ha...
for an element in DOM,such as an "A" element,how to replace it with a "span" instead?
...
OKay, I'm a bit of a javascript n00b, so forgive me if this seems like an obvious question.
I want to write an application using processing-JS, and I'd like to be able to load it with server-side data. I haven't written the server side yet so I can use anything, but it seems the obvious AJAX thing would be to use JSON to upload the d...
Why do javascript sub-matches stop working when the g modifier is set?
var text = 'test test test test';
var result = text.match(/t(e)(s)t/);
// result: ["test", "e", "s"]
the above works fine... [1] is e and [2] is s... perfect
var result = text.match(/t(e)(s)t/g);
// ["test", "test", "test", "test"]
the above it screwed... it ig...
How can I retrieve the mouse location outside of it's assigned event handler function
For example, if Event.MOUSEMOVE = somefuction, how do I say...
someOtherFunction( maybeSomeParams )
{
getCurrentMouseLocn();
}
or
someOtherFunction( maybeSomeParams )
{
mouseXLocn = ?;
mouseYLocn = ?;
}
...
I am trying to change a label's text by using server-side javascript (onclick) and C# within the page_load event. For example, I would like to write something like the following:
Label1.Attributes.Add("onclick", "Label2.text='new caption'")
Does anyone know the correct code for this? Also, what is this type of code referred to; is it...
I want to use the google geocode via HTTP functionality to translate a city name into longitude and latitude in for my AJAX web application.
However, it appears that no callback function exists for the HTTP geocoder functionality
http://code.google.com/apis/maps/documentation/geocoding/index.html
Is that true, no callback function exi...
I am dynamically appending HTML to a webpage and I'm also using jQuery to manage stuff.
When I add HTML code, jQuery ignores its existence.
For example:
$("td.elementToClick").click(...
Will work great with jQuery. But if somewhere in the code I append:
$("tr#myRowToAppend").append("<td class="elementToClick>...</td>");
jQuery wil...
Hi,
One of my XPCOM components make use of other XPCOM components. As I was testing it, I found it cumbersome cos of the dependencies. Then I thought of using Dependency Injection to pass in the other components in my constructor. I wasn't successful. Is it possible to pass in references of other components into your constructor?
var ...
Hello,
$(window).blur(function(){
windowFocus = false;
}).focus(function(){
windowFocus = true;
});
The problem is that in firefox 3, when I create a new tab, it does not lose windowFocus. Where as in ff2, ie7 it does lose. In ff3 it only loses window focus when i select another program.
Anyone have a solution to this problem?
...
I am working on a Firefox add-on that will allow users (all of whom are part of a specific group; this add-on is very limited in audience scope) to see the status of their authentication cookie from the status bar. We all have to authenticate to access work-related sites, but we get no warning when the cookie expires, so this causes anno...
This may seem like a no-brainer, but I can't find a way to do this that isn't considered a security issue (other than the obvious ways)...
So, I want to build an add-on for Firefox to use with my team. Basically it will be a status bar icon letting us know if the authentication cookie for our tools site has expired, so we can tell witho...
I have a thumbnail gallery in a div on my sidebar. Each of these jpg images links to the larger jpg image in the main div of the same page. I have these loading in a div via fadein jquery with the following:
$(function() {
$('.vid-gallery-thumbnail a').click(function() {
newImg = $(this).attr('href');
$('.ngg-imagebrowser img').fad...
I want to go through all the elements on a page using Javascript and see if they have a property set. Is there an easy way to do this, or do I have to use a recursive solution?
...
Hi,
I know this has been asked before, but I've found a different way to get references to controls in external JS files but I'm not sure how this would go down in terms of overall speed.
My code is
public static void GenerateClientIDs(Page page, params WebControl[] controls) {
StringBuilder script = new StringBuilder();
...
Swedish characters get substituted when setting the tabTemplate option.
For example using "ö" in the href:
var $tabs = $("#tabs").tabs('option', 'tabTemplate', '<li><a href="#ö">#{label}</a></li>');
becomes:
<li><a href="#%C3%B6">ö</a></li>
...
jsc.tools.road.correctType = function() {
for(row = jsc.data.selection.startX - 1; row <= jsc.data.selection.endX + 1; row++) {
for(col = jsc.data.selection.startY - 1; col <= jsc.data.selection.endY + 1; col++) {
if(jsc.data.cells[row-1][col].type != "road" && jsc.data.cells[row+1][col].type != "road" && jsc.data...