Hi y'all,
I'm trying to create a customized context menu using the DHTML Popup
object. The HTML that makes up the body of the popup is created in a
variable named 'popCode'. Works like a charm, except when I call a
function in an onclick it gives an 'object expected' error. Here's the
popup function (dopopup) and the function I'm calling (renderData):
function dopopup(Value,Field,x,y) {
popCode='';
popCode+='<html>\n<head>\n';
popCode+='<script type="text/javascript"
src="xTable.js"><\/script>\n';
popCode+='<\/head>\n<body>\n';
popCode+='<table style="border:1pt solid #808080" bgcolor="#CCCCCC"
width="140" height="220" cellpadding="0"
cellspacing="1" oncontextmenu=\"return false;\">\n';
popCode+='<STYLE TYPE="text/css">\n';
popCode+='td {font-family: Tahoma, Arial, Helvetica,
sans-serif;font-size: 8pt;font-style: normal;border:1pt solid
#CCCCCC; background:#CCCCCC;}\n';
popCode+='.over {background:#3366AF;color:#FFFFFF;border:1pt solid
#737B92}\n';
popCode+='<\/STYLE>\n';
popCode+='<script type="text/javascript"
src="xTable.js"><\/script>\n';
popCode+='<tr><td'
popCode+=' onMouseover="className=\'over\';"
onMouseout="className=\'\';" onClick="alert(\'' + Value +'\');">';
popCode+='Filter op: '+Field+' is '+Value+'</td></tr>\n';
popCode+='<tr><td';
popCode+=' onMouseover="className=\'over\';"
onMouseout="className=\'\';" onClick="renderData(\'' + Field
+'\');">';
popCode+='Filter op: '+Field+' is '+Value+'</td></tr>\n';
popCode+='</table>\n';
popCode+='<\/body>\n<\/html>\n';
var oPopupBody = oPopup.document.body;
oPopupBody.innerHTML = popCode;
oPopup.show(x, y, 140, 220, document.body);
}
function renderData(filterField){
alert("Joepie hij doet 't!");
alert(filterField);
}
The onclick in the first td alerts the value properly. The onclick in
the second td makes a call to the function renderData, but since this
function isn't defined within the variable 'popCode', it gives the
error 'Object expected'. I tried linking to the javascript file these
functions are in, in the <HEAD> section, but that's not working
either. Either the <HEAD> section is completely ignored or I'm making
some mistake.
1 Does anyone know how to do this properly, passing the variables to
the renderData function? or
2 Does anyone know how to explicitly state in the second onclick where
the renderData function is to be found?
Please help me, for I am truly really frustrated...Bye
Sharon 2 1607
Sharon wrote: Hi y'all, I'm trying to create a customized context menu using the DHTML Popup object. The HTML that makes up the body of the popup is created in a variable named 'popCode'. Works like a charm, except when I call a function in an onclick it gives an 'object expected' error. Here's the popup function (dopopup) and the function I'm calling (renderData):
It looks as if your code is designed for IE windows exclusively: function dopopup(Value,Field,x,y) { popCode=''; popCode+='<html>\n<head>\n'; popCode+='<script type="text/javascript" src="xTable.js"><\/script>\n'; popCode+='<\/head>\n<body>\n'; popCode+='<table style="border:1pt solid #808080" bgcolor="#CCCCCC" width="140" height="220" cellpadding="0"
height="220" , invalid
cellspacing="1" oncontextmenu=\"return false;\">\n';
"oncontextmenu" IE Win only, I believe, and a bad idea.
popCode+='<STYLE TYPE="text/css">\n'; popCode+='td {font-family: Tahoma, Arial, Helvetica, sans-serif;font-size: 8pt;font-style: normal;border:1pt solid #CCCCCC; background:#CCCCCC;}\n';
8 pt?????? popCode+='.over {background:#3366AF;color:#FFFFFF;border:1pt solid #737B92}\n'; popCode+='<\/STYLE>\n'; popCode+='<script type="text/javascript" src="xTable.js"><\/script>\n'; popCode+='<tr><td' popCode+=' onMouseover="className=\'over\';"
this.className, surely?
onMouseout="className=\'\';" onClick="alert(\'' + Value +'\');">'; popCode+='Filter op: '+Field+' is '+Value+'</td></tr>\n'; popCode+='<tr><td'; popCode+=' onMouseover="className=\'over\';" onMouseout="className=\'\';" onClick="renderData(\'' + Field +'\');">'; popCode+='Filter op: '+Field+' is '+Value+'</td></tr>\n'; popCode+='</table>\n'; popCode+='<\/body>\n<\/html>\n'; var oPopupBody = oPopup.document.body; oPopupBody.innerHTML = popCode;
Looks like you're trying to to place head content into the document body.. oPopup.show(x, y, 140, 220, document.body); }
function renderData(filterField){ alert("Joepie hij doet 't!"); alert(filterField); }
Do you have a URL?
Mick
Yes, you're right, it ís designed for IE6 exclusively, that's because
it's part of a software package. Clients who use that package also use
IE6 only. I don't have an URL, the only head content I'm placing in the
body is the <script>-part. I placed that first in the head, and later
also in the body to see if it would work. But it didn't. Can you help me
call the function renderData() in the onclick of dopopup?
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Moon |
last post by:
Seems I still haven't got the hang of all those window generating code
in Javascript. I've got a page with about 15 photo thumbnails. When you
click on a thumbnail a new window pops up which shows the enlarged
version of said thumbnail. This works fine on all current browsers I've
tested.
However, in case I do not close the popup but click...
|
by: Obantec Support |
last post by:
Hi
i leached some code and strung together a popup i need for a page with 5
help buttons.
Now i could use 5 scripts and pre-load the values but i would rather get a
better understanding of how to pass some extra values to 1 script.
1.
<SCRIPT LANGUAGE="Javascript"><!--
function popUp(url) {
|
by: Shaun McKinnon |
last post by:
HI...Here's my problem...I have a popup window that loads when i want it to,
but it's not sized properly. I've set the size, but it doesn't seem to
work. I've been on 8 different websites to find out what i'm doing wrong,
and so far it seems i'm doing it the right way. Here's my code...any
suggestions would be appreciated.
<script...
|
by: Bijoy Naick |
last post by:
It seems like the BBC sports site is able to get past popup blockers..
For eg.. http://news.bbc.co.uk/sport1/hi/cricket/default.stm. Click on
the Video icon under "Watch and Listen" - right hand frame.
I have a popup blocker installed but the window still pops up.. Any
one know how this can be done?
BTW: I need this functionality for an...
|
by: E Michael Brandt |
last post by:
I have been lurking here for some time, and now would like to ask a
question of you clever coders:
My JustSo PictureWindow 3 Extension for Dreamweaver has stumbled in the
face of the new Opera 8. Jspw3 opens a popup window (using
varname=window.open(...)) but there are now two problems:
1) Opera8 interprets a top,left of 0,0 to be top...
| |
by: PC User |
last post by:
I'm creating a shortcut menu to popup over my richtext box. Its a form
with a listbox of menu items with associated richtext activex (rtf)
editing commands. I found a way to transfer a value from the popup
menu to the form, but now I have one more step to take. The value
being transferred is a public function from a module. I need to find a...
|
by: ALGARCIA |
last post by:
hi, i have a problem when i return a value from my popup y have master in my
parent page and in my popup i don't have one, y have a function like this in
the popup page :
function BotonClicRem(id)
{
window.opener.updateRem1(id);
window.close();
}
|
by: anthony.turcotte |
last post by:
Hi,
I've looked for a solution to this problem on google, read posts in
this newsgroup and I still haven't found anything that could help me.
Here's the scenario.
1. User accesses pageA.html
2. User clicks on menu link to open popup.html
3. pageA.html checks if popup.html is already open. It is not, open
|
by: wreed06 |
last post by:
Hello,
I have 2 problems. In my webpage, I have a dropdown list with a button that takes the user to a popup window specific to the option. I am using Firefox 2.0.0.13. I have successfully validated my HTML and CSS code.
1. When I clear cache and refresh my webpage, it takes 3 tries before the popup window displays - I click on the button...
|
by: wreed06 |
last post by:
I have 2 problems. In my webpage, I have a dropdown list with a button that takes the user to a popup window specific to the option. I am using Firefox 2.0.0.13. I have successfully validated my HTML and CSS code.
1. When I clear cache and refresh my webpage, it takes 3 tries before the popup window displays - I click on the button once, a...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
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. ...
|
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...
|
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
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...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |