I am trying to write a web widget which will allow users to display customized information (from my website) in their own web page. The mechanism I want to use (for creating the web widget) is javascript.
So basically, I want to be able to write some javascript code like this (this is what the end user copies into their HTML page, to ge...
I have an event handler that is called six times when I click on a link.
var elems = elem.getElementsByTagName('a');
var cntr = 0;
for(var a in elems) {
AttachEvent(elems[cntr], 'click', function(e) {
this.reporturl = this.href;
document.getElementById('reportpopup').style.visibility = "visible";
return false;
});
}
I ...
Hi
I am just wondering what is the difference between these two
File1.js
$(function()
{
function MyFunction()
{
// some code here
}
});
File2.js
$(function()
{
// call it.
MyFunction();
});
File1.js
function MyFunction()
{
// some code here
}
File2.js
$(function()
{
// call it.
...
I have the following string:
[assembly: AssemblyVersion("1.0.0.0")]
The issue now is that I have to extract the 1.0.0.0 out. Here's the regular expression that I can come out with:
var pattern = "[^\\/]+\\[[a-z]+:\\s" + "AssemblyVersion"+ "(?:Attribute)?\\((.+)\\)\\]" ;
var theString ="[assembly: AssemblyVersion("1.0.0.0")]";
var...
Ever noticed that when you go to maps.google.com and do a search (say, car wash), it renders a lot of results (represented by small circles) and a few prominent ones (seen as regular-size pins)?
Notice how quickly it does this?
From what I can tell from analyzing this in Firebug, much of this is generated on the server and sent to the ...
I have the user entering a post-number in a form-field, and then I want to display the town with that post-number.
I have the server-side function set up, it takes a variable from the URL and returns a plain string.
As I see it, I need to get the variable from the form-field afterthe user has written it and the focus has left the form-...
Hello, I'm using jquery to make a few divs draggable on a website. My code is similar to this:
$("#thediv").bind('mousedown',function(){
$(document).bind('mousemove',function(ms){
//drag
})
});
The problem is that if the mouse is too fast for the div, the mouse goes outside of the div. This selects random content on the ...
Hi,
I have an asp.net application with an aspx page. In page_Load event of the aspx page,m handling some code which is based on the hidden variable value from the javascript(assigning result of javascript to hidden variable). I am calling the javscript in page_load of child page and in the immediate statement, m making use of the hidden...
<div id="target">
...
</div>
$('#target').html('') will remove the content,but how to check if the listeners or anything else that holds memory is removed at the same time?
...
I would like to ask how can i display Japanese text in Eclipse properly. I work in Japan and the code we have has a lot of Japanese characters. I just notice that for .java and .jsp file, that all the Japanese comments and text are displayed properly as Japanese. However, for other filesm such as js (Javascript) file or inc (include) fil...
Is it possible to have javascript execute in the design view of DreamWeaver CS3? Specifically i would like to be able to have custom tags like:
<myTag:Custom type="flappers" />
render in the DW CS3 IDE as:
<div class="flappers">User would see this text in designer but not the div tag</div>
Im assuming security restrictions would p...
I have same ancors/hyperlink in my html file. These point to a new website outside my site.
So I want that when the user clicks the link it should open a new tab or window. My website page should not be closed.
How can it be done?
...
I pass activerecord data from rails to JavaScript function as JSON using ajax.
my request.responseText looks like this
[{"site": {"lng": 55.1443, "lat": 25.0608}},
{"site": {"lng": 55.1065, "lat": 25.0399}}]
Below is my JavaScript code
var sites=eval('(' + request.responseText + ')');
for (var i = 0 ; i < sites.length ; i++) {
...
Hello everyone..
In my application, I have a Javascript function which get called after every minute. This javascript function returns me new comma seprated string each time which contains image path and image name. I simply split this string and set the Image path to image and text to lable. Goel is to achive effect like image slide sh...
In the absence of the download is complete before using the innerHTML will cause pages to load iframe disorder
In the following example, the first Click "openA" (google page), then "openB" (yahoo page), and then "openA", then A window shown on the wrong yahoo page.
The BUG in chrome and IE does not exist under.
How to avoid this pr...
Anyone know of any software like this?
I've found many datagrids that can handle XML, but none that allow copy and pasting or cloning/duplicating of row data.
...
Hello,
I generate a file server side and I want the client to automatically open it : it's a XLSX file. Firefox just opens the file and I see the binary content of the XLSX file in the browser, but I want it to be open via a Save As... box.
It works fine in Chrome with the same code (it saves it) but not firefox...
Any ideas ?
...
I have many lines on my page generated from database with PHP. Each line is in DIV. I'd like to "select" a line by clicking on it. "Select" means change css for it. What is the easiest way to do it?
...
I've recently asked and had answered this question and it's stopped the issue of the string literal error, however it's now caused another problem
$(document).ready(function()
{
$("#message-list .message").click(function()
{
var msg_id = 1;
msg_id = $(this).attr('id').split('-')[1];
$.ajax({
type: "GET",
url: "ge...
What exactly is the function of the var keyword in Javascript, and what is the difference between:
var someNumber = 2;
var someFunction = function() { doSomething; }
var someObject = { }
var someObject.someProperty = 5;
and:
someNumber = 2;
someFunction = function() { doSomething; }
someObject = { }
someObject.someProperty = 5;
Whe...