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>
-
-
17 2957 gits 5,390
Recognized Expert Moderator Expert
you may find your answer here ... in the JavaScript forum.
regards
you may find your answer here ... in the JavaScript forum.
regards
And a doctype will be needed (if you intend to support any version of Internet Explorer).
Hi Sir,
Read the java weblink you gave and ,
Is it something like that below? tried many times and different ways, used html to activate javascript and it did not work. and used html to activate java embedded in html page, but cant work.
Thanks and Best Rgds,
Andrew
HTML
==== -
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
-
<html>
-
<head>
-
<SCRIPT LANGUAGE="JAVASCRIPT" SRC="j_pop4.js"
-
TYPE="TEXT/JAVASCRIPT">
-
<!--
-
-
//-->
-
</SCRIPT>
-
</head>
-
-
<body>
-
</body>
-
</html>
-
-
JAVAscript that is activated
=============== ===== -
-
<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>
-
-
-
-
-
<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>
-
-
-
-
#The code can be copied and pasted. If you copy by hand beware as it is impossible to tell 2x single quotes '' from a double quotes " in many proportion spaced character sets (fonts).
-
-
Hi Sir,
Something is missing and I tried many different ways and means including alert and still cant work. Please see below a)html and b)javascript. I activated the js script from default apache directory which is htdocs directory where I placed the javascript if you refer the my html above.
Installed IE6
a) html
===== -
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
-
<html>
-
<head>
-
<SCRIPT LANGUAGE="JAVASCRIPT" SRC="j_pop5.js"
-
TYPE="TEXT/JAVASCRIPT">
-
<!--
-
-
//-->
-
</SCRIPT>
-
</head>
-
-
<body>
-
</body>
-
</html>
-
-
javascript
======= -
Expand|Select|Wrap|Line Numbers <script language="JavaScript1.2" type="text/javascript">
-
<!-- ;
-
alert("Welcome to my world!!!");
-
-
gits 5,390
Recognized Expert Moderator Expert
there is nothing missing ... it is just too much ... leave the script-tags out and drop those useless comment ... just the alert() should be left in the JS-file ... here is an example ...
regards
Markus 6,050
Recognized Expert Expert
--Moved to Javascript.
Another thing to note: everything should be lowercase if you wish to comply with HTML standards. The 'language' attribute is deprecated (not needed or supported).
gits 5,390
Recognized Expert Moderator Expert
hi happyse27,
i just closed the following threads that are handling the same issue: http://bytes.com/forum/thread851230.html http://bytes.com/forum/thread852374.html
please try to keep one thread for a specific problem ... since otherwise it would lead to just spreaded information and answers ... i don't feel like merging all the threads since some different lines of code are posted there and some different hints and answers but as far as i could see the problem is always the same and so we should just use this thread here. i linked everything together so we could jump from thread to thread.
kind regards
MOD
Hi Sir,
Thanks and noted, sorry and apologize because I did that because I dont know if it belongs to javascript issue or html's therefore did double post. Anyway, I tried your method. But still the alert message below did not pop up... Checked apache access log is it error 500 and error 543. Kindly advise what is happening???
The example you given..
=============== ==
this is the page where a script is included: -
<html>
-
<head>
-
<script type="text/javascript" src="foo.js"/>
-
</head>
-
<body>
-
</body>
-
</html>
-
and this is in the file foo.js:
Error from apache access if I put javapop.js into apache/cgi-bin directory
=============== =============== =============== ==
127.0.0.1 - - [09/Nov/2008:22:00:28 -0800] "GET /javapop.html HTTP/1.1" 304 -
127.0.0.1 - - [09/Nov/2008:22:00:28 -0800] "GET /cgi-bin/javapop.js HTTP/1.1" 500 543
Error from apache access if I put javapop.js into apache/htdocs directory
=============== =============== =============== ==
127.0.0.1 - - [09/Nov/2008:21:56:24 -0800] "GET /javapop.html HTTP/1.1" 304 -
127.0.0.1 - - [09/Nov/2008:21:56:24 -0800] "GET /javapop.js HTTP/1.1" 304 -
gits 5,390
Recognized Expert Moderator Expert
just clear your browser cache first and try the second method again ... does the files just contain the example?
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Don |
last post by:
I'm writing an html page with some JavaScript that reads a web page
into a client-side temp file, then reformats it, then submits that
same file as a URL to the browser for display, via "locate.replace".
I can do all this if the html page containing the script originates
on the client machine, but don't know how to get access to a
client-side temp file when the same html page containing the script is
on a web host. How do I get access...
|
by: e |
last post by:
I've been having an extremely difficult time finding an answer to this in IE
/ js groups, so I thought I'd try here.
I've got an aspx page that delivers loads of report data into custom-named
<span> tags on the client, hidden from the screen by @media classes. From a
dynamically built menu of what was returned, the user selects wich report
they want to view/print and a little jscript .innerHTML magic happens under
the hood that copies...
|
by: punchbag |
last post by:
Hi all,
There has recently been a new update to internet explorer whereby
activex controls now load on a page unactivated. MSDN have a website
explaining a workaround where you do away with the <OBJECT> tag in your
html and instead use an external Javascript the control will load
activated.
http://msdn.microsoft.com/library/?url=/workshop/author/dhtml/overview/activating_activex.asp
|
by: dominic.martin |
last post by:
Hi,
I'm no javascript programmer but I found a really good piece of
javascript at http://www.isdntek.com/tagbot/zipzoom.htm that magnifies
areas of an image. It's just what I want but their example only allows
for a button in the HTML body to turn the magnifier on:
<input type="button" onclick="initMagnifier()" value="Use Magnifier">
I would like two buttons; one to activate the magnifier and one to
|
by: Frank |
last post by:
Hi,
I am working with VS.NET 2005
Ultimately, I wish to call a JavaScript function from a .js file
| |
by: Ed |
last post by:
I'm writing a VBA macro in Word 2003 that finds and manipulates a web
page (Win XP, IE6 sp2). I am having trouble with a checkbox. I can
find the checkbox and make it checked, but I can't figure out how to
activate the function connected to the OnClick event. Would anyone be
able to help me out here, please?
Thanks.
Ed
|
by: happyse27 |
last post by:
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |