Community Support
December 01, 2008, 04:03:44 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Staff List Login Register  
Pages: [1]
  Print  
Author Topic: Little useful scripts  (Read 37 times)
Burke
New User
*
Offline Offline

Hosting Plan: Premium Hosting
Posts: 5
Referrals: 0



WWW
« on: June 13, 2008, 08:49:14 PM »

Here are some snippets I've come across:


Have a pop-up window, and would like to have a close button, like you see on other sites:

Code:
javascript:window.close();

--------------------------

Re-Direct:

Code:
<meta http-equiv="refresh" content="0; url=http://www.yoursite.com/">

--------------------------

Read Only Text Box:

After text box name in HTML, add: readonly="true"

--------------------------

Scrolling text box:

Code:
<div style="overflow:auto; height:250px; width:300px;">
FORMATTED TEXT GOES HERE
</div>

--------------------------

MouseOver Link Hider:

Code:
<a href="http://www.yoursite.com/" style="font-size:12px;color:#ffffff;font-family:verdana;"
onMouseOver="window.status='TEXT HERE'; return true;" onMouseOut="window.status=''; " target="_top">TEXT HERE</a>

Email W/ Image:

Code:
<a href="mailto:you@yoursite.com" onMouseOver="window.status='TEXT HERE'; return true;" onMouseOut="window.status=''; "><img border="0" src="image url here" width="96" height="64"></a>

Email W/ Text:

Code:
<a href="mailto:you@yoursite.com" onMouseOver="window.status='TEXT HERE'; return true;" onMouseOut="window.status=''; ">TEXT HERE</a>

--------------------------

Alt tag on text code

Code:
<span title="Your Message Here!"><b>HOVER YOUR MOUSE HERE.</b></span>

To add an alt tag to a text link would be like this;
Code:
<span><a href="index.html" title="Your Message Here!" target="_blank">Click Here</a></span>

--------------------------

Link Pop-Up Alert:

Code:
<a href="http://www.yoursite.com"
onMouseOver="alert('YOUR MESSAGE HERE');return true;">Link Text Goes Here</a>

--------------------------

Go Back:

Code:
<a href="#" onClick="history.go(-1)">Back</a>

Or:

Code:
<input type=button value="Back" onClick="history.go(-1)">


--------------------------

Accept or Deny:

Code:
<input type="submit" name="Submit" value="Accept" onclick="window.location.href='http://www.yoursite.com'"/>

Code:
<input type="submit" name="Submit2" value="Decline" onclick="window.location.href='http://www.google.com'"/>
Logged

Un chien andalou
New User
*
Offline Offline

Hosting Plan: Free Hosting
Posts: 9
Referrals: 0


« Reply #1 on: September 03, 2008, 08:20:05 PM »

the meta refresh for redirect is a baaaaaad practice.

Use php:
Code:
<?php
header
('HTTP/1.1 301 Moved Permanently');
header('Location: http://my-new-kickass-homepage.ext');
?>
or .htaccess (with mod_rewrite):
Code:
RewriteEngine on
RewriteRule (.*) http://my-new-kickass-homepage.ext/$1 [R=301,L]
instead.
Logged
Burke
New User
*
Offline Offline

Hosting Plan: Premium Hosting
Posts: 5
Referrals: 0



WWW
« Reply #2 on: September 10, 2008, 09:27:34 AM »

I mainly use the meta one, so I can just have that in a index page for extra folders in a site's directory.
For example, the images directory, and some others that are needed to keep my directory structure organized. Smiley
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC | Sitemap | Archive Valid XHTML 1.0! Valid CSS!