Is there a way to specify common elements for object literals in an array?
For example:
var array = [ {key: "hi", label: "Hi", formatter:deleteCheckboxFormatter},
{key: "hello", label: "Hello", formatter:deleteCheckboxFormatter},
{key: "wut", label: "What?", formatter:deleteCheckboxFormatter}];
All three r...
I've been using the following code to detect browser client area width for ages and it wokred 100% with all browsers, including FF, Safari and various versions of IE. However, now when I switched to a new monitor with widescreen resolution (1280x800) this code fails on IE8. It reports clientwidth of 1024 !!!???
Any ideas how to get the ...
Hello All-
I know there are some tools and techniques for delaying the load of javascript, but I have an iframe that I would like to delay loading until after the rest of the page has finished downloading and rendering (the iframe is in a hidden that will not be revealed until someone clicks on a particular tab on the page. Is there a...
I used the cocoa of MAC to develop a plugin with safari , I used the method is : changed the plugin's MIME TYPES is application/x-shockwave-flash and extensions is swf, so when safari lanched , it will add my plugin , but Now have a problem : when the safari page showing , the swf embed it don't show , because I don't know the method of...
I want to access the tag data so that I can send this image to the server (database) after manipulation using Javascript image processing libraries.
...
I made this PHP chatbox which supports some JavaScript code.
I have these 'images' which if you click them make special codes inside the textfield. e.g:
<head>
<script language="javascript">
function addCode(code)
{
document.writeform.bericht.value+=code;
document.writeform.bericht.focus();
}
</head>
<bo...
Hi,
I have tinymce editor(textarea) and one div. Whenever i type inside the text editor, it shows at the preview div which is (200px) in real time which is looks alike stackoverflow preview.
What I want to achieve is, if we type one words without space and if exceed 200px, I want to wrap it to the next line.
I tried to find it and I...
Using the Angular framework, how do I have the "submit" button both update the current entity as well as clear the anchor ID - I basically want to rapid-fire add entries, but it always turns my add form into an edit form. Here's my current div which isn't working, it's like it's ignoring the "$anchor.task=null"...
Note that the "Add New...
Hello,
i have this PHP based doc (chatbox) where you can type your message and send it.
Now, i have this fade animation where a message comes in when a message is send. Looks like this:
Javascript:
function stateChanged1()
{
if (xmlHttp1.readyState==4)
{
document.getElementById("sent").innerHTML="Sent!";
document.writeform.message...
Hey,
when i edit the HTML source from:
<div />
the result is always something like:
<div></div>
i don't want that.. it should leave my code alone ;)
here is the config:
tinyMCE.init({
// General options
mode : "textareas",
theme: "advanced",
element_format : "xhtml",
remove_linebreaks: false,
remove_redundant_brs: false,...
I'm removing an element using remove() (it's a <li> with display: inline; set, although the same problem seems to exist with display: block;), and while the element is removed from the page the space it was occupying isn't.
Is this standard behaviour and so should I be using another method instead? The <li> contains a form field, so I'm...
What is the best way to set up a local fallback image if the external image does not load or takes too long to load.
...
Recently I saw this piece of Javascript code, but unable to understand what it is trying to do.
var f = function(a) {
return function() {
alert(a());
};
};
f(function() { return "Hello World"; })();
Please explain what it is trying to do.
...
What are some good ways to deal with this messy and unnecessary and not-really-dynamic generation of JavaScript:
var <%# JavascriptId %> = new BusinessChart(
'<%# JavascriptId %>',<%# CurrentUserId %>,'<%# ChartId %>'
,'<%# Helper.GetBaseUrl() %>','<%# ChartPath %>'
,'<%# Helper.ResolveUrl("~", true) %>'
);
<%# JavascriptId...
I need to write my next project using ExtJs.
It's a nice Javascript lib but I don't fully understand the idea behind it.
Take the docs page for example:
http://www.extjs.com/deploy/dev/docs/
Am I supposed to write my web applications with extjs like that?
One page that should never be refreshed,
and everything getting done by AJAX?
How...
I'd like to write a simple game using the Raphael javascript library, but one question is sticking in my mind.
How does one handle keyboard input? I've looked through the reference material and haven't found any reference to this. Can you simply pass it the standard JavaScript keypress methods?
...
I have a fairly large js lightbox gallery and an hasty user can click on a thumb before the page has finished loading, this may result in opening the actual image without the "cool" js popup effect.
Are there nice ways of "forcing" the user to wait for the page to finish loading before clicking?
Thank you very much
...
I'm trying to submit data to a web service in my project. The data's in the form of several fields, so I'd rather create a single object and submit that. I know I can submit it as a JSON object, but I thought I'd seen code somewhere that would create a C# object on the JS side so that I could submit it to the web service.
Am I crazy, or...
It doesn't really have to add newlines, just something readable.
Anything better than this?
str = "line 1" +
"line 2" +
"line 3";
...
I have a html page with a button pop-up. If I click on this button a new window Pops-up, I do all of my changes in this window and then click the close button. The html page with the popup button should refresh after I closed the pop-up window. Is this possible?
...