Search results for 'include'. 3 post(s) found.
- 2008/10/27 How to include file in JSP ?
- 2008/01/25 How to include Javascript from anonther ?
- 2007/10/16 How to include a file with error reporting ?
Just like ASP, or PHP, JSP is also allow to include for programmer by include function.
Here's the simple example.
Another posts included in "JSP"
| How to add a declaration on JSP code ? (0) | 2008/10/27 |
| How to set and get sessions on JSP code ? (0) | 2008/10/27 |
| How to resize image ? (0) | 2009/06/03 |
| How to print out text strings on HTML directly ? (0) | 2008/10/27 |
| Put Date Time on HTML (0) | 2008/10/27 |
| Send An Email Using A Bean (0) | 2007/08/31 |
| JQuery And Function Chaining (0) | 2007/08/31 |
Trackback : Cannot send a trackbact to this post.
Actually there is such a function in PHP which function is "include".
It's very strong function.
But Javascript does not support such a function.
Here's the alternate method to do that.
To include javascript, following is using usually:
<script type="text/javascript" src="the_script.js"></script>
But above script is not available in Javascript so following is the alternate method to include another javascript.
the_another_javascript.js:
document.write( "<script type=\"text/javascript\" src=\"the_script.js\"></script>");
Isn't it simple ?
Actually the main logic above is writing script tag in the document.
Another posts included in "HTML, Javascript"
| IFRAME Auto Resize in IE, FireFox by Javascript (13) | 2008/05/03 |
| Clipboard copy function working (0) | 2008/10/17 |
| How to find the ip address of a client machine from a web application? (0) | 2009/03/21 |
| Javascript based Browser Sniffing (0) | 2008/01/25 |
| Javascript based Regular Expression Tester (0) | 2008/01/15 |
| Two useful string functions - substr & substring (0) | 2008/01/15 |
| Is there URLEncode function in Javascript ? (0) | 2007/10/11 |
| Move window (0) | 2007/09/07 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 03:53
moneyideas
-
Subject different money making ideas
2010/01/29 12:45
moneyideas
-
Subject different money making ideas
2010/01/31 16:43
moneyideas
Sometimes you want to be able to give some feedback if a PHP include has failed. Here is a version using the fopen command, which can search the include path.
<?php
$includefile="foo.php";
//using fopen to verify file. the third parameter triggers include_path search
$handle = fopen($includefile, "r", 1);
if ($handle) {
fclose($handle);
include ($includefile);
} else {
echo "file: $includefile not found in path";
echo "handle is: $handle";
}
?>
$includefile="foo.php";
//using fopen to verify file. the third parameter triggers include_path search
$handle = fopen($includefile, "r", 1);
if ($handle) {
fclose($handle);
include ($includefile);
} else {
echo "file: $includefile not found in path";
echo "handle is: $handle";
}
?>
Here's another example much better simple than the above. As you can see, just add @ in front of the function you will use. By '@', the error message will be ignored. (not be shown)
Another posts included in "PHP"
| How to check if a file exists ? (0) | 2007/10/16 |
| How to force cookies, disable php sessid in URL ? (0) | 2007/10/16 |
| How to make random number ? (0) | 2007/10/16 |
| PHP if...else... example (0) | 2007/10/16 |
| PHP form handling example in single page (0) | 2007/10/16 |
| How to get reffering URL ? (0) | 2007/10/16 |
| How to convert formatted date time string to datetime? (0) | 2007/10/12 |
| How to remove or set time limit that defined as max_execution_time in p... (0) | 2007/09/18 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 05:40
moneyideas
-
Subject different money making ideas
2010/01/29 14:09
moneyideas
-
Subject different money making ideas
2010/01/31 16:42
moneyideas

Prev

Rss Feed