In order to put e-mail addresses on my sites, I use this Javascript:
function showEmailLink(user, domain, linkText) {
if (linkText == "") {
linkText = user + "@" + domain;
}
return document.write("<a href=" + "mail" + "to:" + user + "@" + domain
+ ">" + linkText + "<\/a>");
}
so that in my HTML I can write this:
please send m...
Over the last couple of days I have been collecting a set of "new era" web editors, that is leaving out FCKeditor and tinyMCE, mainly because they try to make the web Word. So far this is what I got:
Text Oriented
http://markitup.jaysalvat.com/home/ (used by bitbucket)
http://github.com/derobins/wmd/tree (used by SO)
http://www.wymed...
I want to use greasemonkey to scrape wiki data from Last.fm (this is not possible with their REST api). I can grab the page fine with GM_xmlhttpRequest(), and it is returning properly.
I do not want to use a DOM processor to process the whole page, since I only want a small chunk, so I'm using regular expressions.
The wiki data is in t...
I am passing a PHP array to a javascript function. The only way I know to do this is to create a js array from the PHP array and pass that to the js function. But this creates a huge chunk of code to transfer (see code below - there's a lot more but I'm sure you get the general idea). I suspect that there is a more efficient method. Woul...
I found the following script for increase and decrease font size but does anyone have any idea how to do the function for default font?
var min=8;
var max=18;
function increaseFontSize() {
var p = document.getElementsByTagName('div');
for(i=0;i<p.length;i++) {
if(p[i].style.fontSize) {
var s = parseInt(p[i].style.f...
I have declared an array in the form:
var refs = {
'EE810': "Presence Detector 1 Channel",
'EE871': "Motion Detector Outdoor 220/360Deg Blk",
'EE870': "Motion Detector Outdoor 220/360Deg WH",
'EE811': "Presence Detector 2 Channel",
'EE805': "Motion Detector Indoor White Flush",
'EE862': "Motion Detector Alum Outdoor 220 Deg",
}
...
I know there is a method like this :
setTimeout("functionA();",1250);
That can delay my process, but the problem is , the functionA have some value to return. When I use this way, it is not get me back the functionA return value:
this.sth = setTimeout("functionA();",1250);
I means, this.sth is not the result I want.
...
I'm trying to set the width & height property of an image element i've created in javascript. In FF, Opera & Chrome it's sets the width & height correctly. However in IE 6 & 7 (Haven't tried 8) the width & height remain 0 until the image is downloaded. The reason I need this is so that i can position each image in rows & cols based on it...
I have an HTML page that uses AJAX to retrieve messages from a server. I'm appending these messages to a as they are retrieved by setting its innerHTML property.
This works fine while the amount of text is small, but as it grows it causes Firefox to use all available CPU and the messages slow down to a crawl. I can't use a textbox, bec...
<div id="container">
some content
</div>
Say the container div is resizable, while resizing how do I know if it's already overflowed( inner content width < container width or inner content height < container height )?
...
I'm having a little trouble figuring out a fast way to accomplish a (seemingly) simple task. Say I have the following html:
<ul>
<li>One</li>
<li>Two</li>
<li id='parent'>
<ul>
<li>Three</li>
<li>
<ul>
<li>Four</li>
<li id='child'>Five</li>
</ul>
</li>
<li>Six</li>
...
Hi,
I have two javascript functions.
First one is:
function gallery(page)
{
$.scrollTo( '#'+page, 1000, '#' );
}
The next one is like this:
window.onscroll = function ()
{
makeCallv();
}
Here i want to disable window.onscroll function when gallery function is called. And s...
I'm using Lightwindow v2 in a Symfony project to create a modal window (here is the plugin I'm using). The modal window works perfectly on my local wamp server. But when I access the page from my remote AWS server, the "greyed out" background element of the lightwindow is too short--it covers the part of the screen that is initially vis...
Suppose a HTML document has a iframe.
Using javascript,I want to detect ,on load of the html document, whether the body of the iframe document is ready to be displayed.
I want to be able to overwrite the the body contents (before it actullay loads) of the iframe.
Any suggestions? can I do it with jquery?
say if ,HTML doc is
<html>
<...
heya
I use jQuery/AJAX to send queries to MySQL. It works flawless in FF and Chrome, but in IE(7) you have to wait a couple of seconds before you change "option" in the select box. Or else no value returns. While in FF and Chrome you can do it immedadtly.
countrycodes value is set, but it dont always get to query.php.
<script type="tex...
In my application I want to open some files with the correct default programmes, like .doc file should be open with WORD and .psd files should be opened with Photoshop if it is installed, and this should be done under html or java script.
Please tell me how to do it.
...
function menuhover(id,state){
if(id=="home"){
if(state=="over"){
document.getElementById(id).src="pages/styles/images/home1hover.png";
} else if(state=="out"){
document.getElementById(id).src="pages/styles/images/home1.png";
}
} else if(id=="news"){
if(state=="over"){
document.getElementById...
I have a div normaldiv1 with class normaldiv.
I am trying to access its z-index through the style property but it always returns 0 although it's set to 2 in the stylesheet.
CSS:
.normaldiv
{
width:120px;
height:50px;
background-color:Green;
position: absolute;
left: 25px;
top:20px;
display:block;
z-i...
Say I have the following :
var a = $("#a");
var b = $("#b");
//I want to do something as such as the following :
$(a,b).click(function () {/* */}); // <= does not work
//instead of attaching the handler to each one separately
Obviously the above does not work because in the $ function, the second argument is the context, not anoth...
I have one parent DIV, with two inner DIVs, each taking up 50% of the screen. Looking for suggestions to achieve the following:
I would have a 'Maximize button' on each of those inner DIVs, which would set the width of the DIV on which the button was clicked to 100% width of the parent DIV, making the other one invisible.
I believe j...