Hi All,
The html page(see item a below) is calling javascript(item b below), but cant work as the page show blank. Not sure if the method of calling is wrong(in terms of default directory) or javascript is wrong.
using 127.0.0.1/htmlscript.html below to call the java script embedded in the following html script.
I am using apache server and apache server have error 304(not modified)
Been trying many methods for past 1 week...
Not sure where went wrong?
Thanks and Best Rgds,
Andrew
a) html page
========= -
<html>
-
<head>
-
<SCRIPT LANGUAGE="JAVASCRIPT" SRC="j_pop4.js"
-
TYPE="TEXT/JAVASCRIPT">
-
<!--
-
-
//-->
-
</SCRIPT>
-
</head>
-
-
<body>
-
</body>
-
</html>
-
b) javascript
========= -
<html>
-
<head>
-
<TITLE>Java Popup Window Example with size, title and background colour parameters</TITLE>
-
<script language="JavaScript1.2" type="text/javascript">
-
<!-- ;
-
var newwindow;
-
var wheight = 0, wwidth = 0;
-
-
function popitup5(url, title, iwidth, iheight, colour) {
-
var pwidth, pheight;
-
-
if ( !newwindow || newwindow.closed ) {
-
pwidth=iwidth+30;
-
pheight=iheight+30;
-
newwindow=window.open('','htmlname','width=' + pwidth +',height=' +pheight + ',resizable=1,top=50,left=10');
-
wheight=iheight;
-
wwidth=iwidth;
-
}
-
-
if (wheight!=iheight || wwidth!=iwidth ) {
-
pwidth=iwidth+30;
-
pheight=iheight+90;
-
newwindow.resizeTo(pwidth, pheight);
-
wheight=iheight;
-
wwidth=iwidth;
-
}
-
-
newwindow.document.clear();
-
newwindow.focus();
-
newwindow.document.writeln('<html> <head> <title>' + title + '<\/title> <\/head> <body bgcolor= \"' + colour + '\"> <center>');
-
newwindow.document.writeln('<img src=' + url + ' title=\"' + title + '\" alt=\"' + title + '\" >');
-
newwindow.document.writeln('<\/center> <\/body> <\/html>');
-
newwindow.document.close();
-
newwindow.focus();
-
}
-
-
// Routines to tidy up popup windows when page is left
-
// Call with an onUnload="tidy5()" in body tag
-
-
function tidy5() {
-
if (newwindow && !newwindow.closed) { newwindow.close(); }
-
}
-
-
// Based on JavaScript provided by Peter Curtis at www.pcurtis.com -->
-
</script>
-
-
</head>
-
-
<BODY onUnload="tidy5()" >
-
-
<A HREF="javascript:popitup5('0002.jpg','Temple of Heavenly Bliss', 384, 288,'white')"><IMG SRC="0002.jpg" WIDTH="160" BORDER="0" HEIGHT="120" HSPACE="10" VSPACE="5" ALT="Temple of Heavenly Bliss" TITLE="Temple of Heavenly Bliss" ALIGN=left></A>
-
-
-
-
</body>
-
</html>
-
-
4 5238 gits 5,390
Expert Mod 4TB
you just have to cut all the html-tags in the .js-file ... since just JavaScript code has to be in it ...
regards
Hi Sir,
Thanks!. I tried, but cant work... Not sure what is the sample java script format when called from html?
Is it like this below? tried before but cant work. Tried other scripts below and cant work...
Thanks and best Rgds,
Andrew
javascript
======= -
-
<TITLE>Java Popup Window Example with size, title and background colour parameters</TITLE>
-
<script language="JavaScript1.2" type="text/javascript">
-
<!-- ;
-
var newwindow;
-
var wheight = 0, wwidth = 0;
-
-
function popitup5(url, title, iwidth, iheight, colour) {
-
var pwidth, pheight;
-
-
if ( !newwindow || newwindow.closed ) {
-
pwidth=iwidth+30;
-
pheight=iheight+30;
-
newwindow=window.open('','htmlname','width=' + pwidth +',height=' +pheight + ',resizable=1,top=50,left=10');
-
wheight=iheight;
-
wwidth=iwidth;
-
}
-
-
if (wheight!=iheight || wwidth!=iwidth ) {
-
pwidth=iwidth+30;
-
pheight=iheight+90;
-
newwindow.resizeTo(pwidth, pheight);
-
wheight=iheight;
-
wwidth=iwidth;
-
}
-
-
newwindow.document.clear();
-
newwindow.focus();
-
newwindow.document.writeln('<html> <head> <title>' + title + '<\/title> <\/head> <body bgcolor= \"' + colour + '\"> <center>');
-
newwindow.document.writeln('<img src=' + url + ' title=\"' + title + '\" alt=\"' + title + '\" >');
-
newwindow.document.writeln('<\/center> <\/body> <\/html>');
-
newwindow.document.close();
-
newwindow.focus();
-
}
-
-
// Routines to tidy up popup windows when page is left
-
// Call with an onUnload="tidy5()" in body tag
-
-
function tidy5() {
-
if (newwindow && !newwindow.closed) { newwindow.close(); }
-
}
-
-
// Based on JavaScript provided by Peter Curtis at www.pcurtis.com -->
-
</script>
-
-
</head>
-
-
<BODY onUnload="tidy5()" >
-
-
<A HREF="javascript:popitup5('0002.jpg','Temple of Heavenly Bliss', 384, 288,'white')"><IMG SRC="0002.jpg" WIDTH="160" BORDER="0" HEIGHT="120" HSPACE="10" VSPACE="5" ALT="Temple of Heavenly Bliss" TITLE="Temple of Heavenly Bliss" ALIGN=left></A>
-
-
gits 5,390
Expert Mod 4TB
have a close look at the following example:
this is the page where a script is included:
[HTML]
<html>
<head>
<script type="text/javascript" src="foo.js"/>
</head>
<body>
</body>
</html>
[/HTML]
and this is in the file foo.js:
regards
gits 5,390
Expert Mod 4TB
i'm closing this thread to let everything go here in this thread ... since now there are to much threads spread in the forum regarding this issue.
regards
MOD
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Phil Powell |
last post by:
I am having a potential PHP/Javascript/HTML conflict going on in my
code that I simply can't resolve - been wracking my brain for a good
hour over this one and have come up with no good solution.
...
|
by: Sergio del Amo |
last post by:
i,
I have the next html page
<html>
<head>
<script>
<!--
function insertcode()
{
var code ="<p> blablabal babala babababab</p><h1>here comes
header</h1><span>fadfafa<a...
|
by: Per Jessen |
last post by:
This is a javascript question, possibly somewhat inappropriate for this group,
but here we go: (please redirect me to the right place to ask).
In Microsoft Internet Explorer (5 and up) using...
|
by: sneill |
last post by:
MXLogic, a Denver, Colorado based software company with 100+ employees
is looking for candidates with **VERY STRONG** AJAX, Javascript, HTML,
and CSS skills.
Our company is building...
|
by: gkellymail |
last post by:
I have a small javascript/html code below that demonstrates that
problem I'm having in a larger program. I've tried all kinds of things
to get it to work, but it just won't do what I want. I've...
|
by: pronerd |
last post by:
Hi,
I am trying to dynamically set an event handler across frames. I have no problems setting properties across frames doing something like
parent.ToolMenuFrame.location.href =...
|
by: Tony Girgenti |
last post by:
Hello.
I just finished reading two articles about javascript here:
http://msdn2.microsoft.com/en-us/library/bb332123(VS.80).aspx
I tried some javascript testing in VS2005, SP1, VB , .NET 2.0,...
|
by: jim |
last post by:
I am seeking a .Net component that handles CSS, Javascript, HTML and PHP
editing, validation and auto-completion (intellisense would be great).
I have searched Google and componentsource but have...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |