I have an iframe that returns data to the top.document window just fine by using:
$("#someDiv", top.document).html(data);
The above works fine. Now I want to be able to hide a div on the top document and I try:
$("#someDiv", top.document).toggle("slow");
It is not working... any ideas?
...
I received a complaint about buttons disappearing and odd formatting of a web application that I support. Upon troubleshooting, it seemed that the only thing new about the environment (which was previously working fine) was the installation of webex on the client machine.
Uninstalling webex resolved the issue. Please mind that webex...
I have a variable that I'm using to build a JavaScript function call, and JavaScript's .replace() to surround the line of text with a span and onclick event. The .replace() portion looks like this:
code.replace(/(\d{4}\s+)?(LOCAL|PARAMETER|GLOBAL)\s+USING\s+([\S]+)/g,
"<span class=\"natprint_popup\" onclick=\"getNaturalCode('"
...
I'm wondering if animating the scrollbars with Javascript triggers browser reflow.
Any difference across different browser implementations?
window.pageXOffset & window.pageYOffset
document.documentElement.scrollLeft & document.documentElement.scrollTop
document.body.scrollLeft & document.body.scrollTop
Thanks!
...
So here's my problem:
I've got one function that runs every 15 seconds. It checks to see if new comments have been added to a page.
I've got a form that submits a new comment once the submit button is pressed, then displays the new comment on the page.
In the process of adding a new comment, the "checkEvery15Seconds" function is query...
I've built a data-driven google map with different icons that get assigned to the map depending on the type of item located. So if I have 5 types of landmark, and each gets a different icon (store, library, hospital, etc.)-- what I'd like to do is generate the google icon objects dynamically. I was thinking something like this:
types = ...
Here is a lisp procedure that simply adds 'a' to the absolute value of 'b':
(define (a-plus-abs-b a b)
((if (> b 0) + -) a b))
I think this is beautiful, and I am trying to find the best way of writing this in JavaScript. But my JavaScript code is not beautiful:
var plus = function(a,b) {
return a + b;
};
var minus = function(...
Code as reference:
http://jsbin.com/aboca3/2/edit
In this example above (thank you SLaks) I am truncating long unordered lists and providing a toggle link to view the entire thing.
The issue, from a usability standpoint, is that as a full list, it is best sorted alphabetically, which will be the default sort order (the source order). ...
given i have the following block of code
(function(){
var mb = {
abc:function(){
//do something
},
xyz:function(width, height, site){
//do something
}
};
})();
how do i make the method mb.abc accessible from the page, but not mb.xyz?
...
I am trying to set a hidden layer (containing animated GIFs) visible. Initially, the layer is hidden using
display: none;
However, when I try to show the layer using javascript:
document.getElementById('loading_layer').style.display = 'block';
the layer is displayed, but the images inside it are no longer animated. What could be th...
Possible Duplicates:
Why 81.66 * 15 = 1224.8999999 in Javascript (or Perl) and not 1224.9 ?
Is JavaScripts math broken?
var t1 = 5000;
var t2 = 0.07;
alert(t1 * t2);
Here is very simple code that return incorrect result;
I predict the result is 350
but the result is 350.00000000000005
How can I get correct result?
and ...
The main issue I'm thinking about is whether assigning a variable in an if statement is safe and reliable across different browsers. If it is safe, I'd like to use it.
Here it reads the querystring and if the querystring variable SN is either Twitter or Facebook then it enters the if and you can use the variable, if the querystring var...
Is there any javascript function that can encrypt data: For example i want to use encrypted data in my URL passed by ajax GET request,
http://sample.com/mypage/TDjsavbuydksabjcbhgy
where TDjsavbuydksabjcbhgy an encrypted data equivalent to 12345.
Now i want to retrieve that data in PHP by decrypting it, so that i can use the 12345.
I...
If I have some event handlers registered inline with my markup (deprecated, I know) like
span id="..." onclick="foo(p1,p2,p3)"
how can I access the "event" object in the event handler function foo? Changing the above to
span id="..." onclick="foo(event,p1,p2,p3)"
and then using it in "foo" like
function foo(e,p1,p2,p3)
{
if ...
My company had a website we're working on redone by a designer. It looks much better, but I've hit a snag implementing their design in HTML+CSS. They have a heavily styled <select> box, so much so that I couldn't recreate it with pure CSS. I found a solution that uses Javascript to replace the <select> box with a <ul>. This works almost ...
I am using the jQuery datepicker(http://keith-wood.name/datepick.html) and I would like to set today's date on the calendar to a date of my choosing that never changes rather than take the system date as today's date. How can I set that up?
...
I am trying to understand how a single and multidimensional javascript array would appear in JSON. Can anyone help me with an example for each?
...
How to call multiple functions on button click event?
Here is my button,
<asp:LinkButton ID="LbSearch" runat="server" CssClass="regular" onclick="LbSearch_Click"
OnClientClick="return validateView();ShowDiv1();">
But my ShowDiv1 Doesnt get called....
My javascript functions,
function ShowDiv1()...
I want to be able to enter data and use Javascript onChange/onBlur/etc to render a "live" print preview; with page breaks. The ultimate goal is to have a PDF file that can be saved/emailed/etc that will be identical to the "preview". The data is to be stored in a MySQL database, I'm figuring AJAX to write it while entry.
Has anyone hear...
I have a window that is created via window.open.
When the window is created, we turn off the address bar (location=no).
In IE6 this left the forward and back buttons active. The MSDN actually notes that this behaviour has changed for IE7 (http://msdn.microsoft.com/en-us/library/ms536651(VS.85).aspx ).
The Back, Forward, and Stop comm...