Jump to content
Zamolxis666

Code snipets for web developers

Recommended Posts

Posted

1. How to embed a flash movie into html.


<object type="application/x-shockwave-flash"
data="your-flash-file.swf"
width="0" height="0">
<param name="movie" value="your-flash-file.swf" />
<param name="quality" value="high"/>
</object>

2. How to use Google Maps in order to get directions, using HTML.


<form action="http://maps.google.com/maps" method="get" target="_blank">
<label for="saddr">Enter your location</label>
<input type="text" name="saddr" />
<input type="hidden" name="daddr" value="350 5th Ave New York, NY 10018 (Empire State Building)" />
<input type="submit" value="Get directions" />
</form>
<!--saddr = blank input field for entering START address-->
<!--daddr = hard-coded END address-->

3. How to select multiple files.


<form method="post" action="upload.php" enctype="multipart/form-data">
<input name='uploads[]' type="file" multiple>
<input type="submit" value="Send">
</form>

The PHP file(you can then loop through the data as an array):


foreach ($_FILES['uploads']['name'] as $filename) {
echo '<li>' . $filename . '</li>';
}

4. Build a test page which has a basic css, loads jquery from google and sets up DOM-ready block for jQuery.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

<title>Test Page</title>

<style type="text/css">
* { margin: 0; padding: 0;}
</style>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>

<script type="text/javascript">
$(function(){
// Do stuff.
});
</script>
</head>

<body>

</body>

</html>

sursa + mai multe aici: Very Useful Code Snippets For Web Developers | Top Design Magazine - Web Design and Digital Content

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...