473,378 Members | 1,438 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Popup problems

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
Jul 23 '05 #1
2 1597
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
Jul 23 '05 #2
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!
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
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...
5
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...
38
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...
8
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...
7
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...
2
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...
0
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...
7
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...
2
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...
5
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...
0
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
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,...
0
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$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
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...
0
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.