473,662 Members | 2,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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,F ield,x,y) {
popCode='';
popCode+='<html >\n<head>\n';
popCode+='<scri pt type="text/javascript"
src="xTable.js" ><\/script>\n';
popCode+='<\/head>\n<body>\n ';
popCode+='<tabl e style="border:1 pt solid #808080" bgcolor="#CCCCC C"
width="140" height="220" cellpadding="0"
cellspacing="1" oncontextmenu=\ "return false;\">\n';
popCode+='<STYL E TYPE="text/css">\n';
popCode+='td {font-family: Tahoma, Arial, Helvetica,
sans-serif;font-size: 8pt;font-style: normal;border:1 pt solid
#CCCCCC; background:#CCC CCC;}\n';
popCode+='.over {background:#33 66AF;color:#FFF FFF;border:1pt solid
#737B92}\n';
popCode+='<\/STYLE>\n';
popCode+='<scri pt type="text/javascript"
src="xTable.js" ><\/script>\n';
popCode+='<tr>< td'
popCode+=' onMouseover="cl assName=\'over\ ';"
onMouseout="cla ssName=\'\';" onClick="alert( \'' + Value +'\');">';
popCode+='Filte r op: '+Field+' is '+Value+'</td></tr>\n';
popCode+='<tr>< td';
popCode+=' onMouseover="cl assName=\'over\ ';"
onMouseout="cla ssName=\'\';" onClick="render Data(\'' + Field
+'\');">';
popCode+='Filte r op: '+Field+' is '+Value+'</td></tr>\n';
popCode+='</table>\n';
popCode+='<\/body>\n<\/html>\n';
var oPopupBody = oPopup.document .body;
oPopupBody.inne rHTML = popCode;
oPopup.show(x, y, 140, 220, document.body);
}

function renderData(filt erField){
alert("Joepie hij doet 't!");
alert(filterFie ld);
}

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...By e
Sharon
Jul 23 '05 #1
2 1618
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,F ield,x,y) {
popCode='';
popCode+='<html >\n<head>\n';
popCode+='<scri pt type="text/javascript"
src="xTable.js" ><\/script>\n';
popCode+='<\/head>\n<body>\n ';
popCode+='<tabl e style="border:1 pt solid #808080" bgcolor="#CCCCC C"
width="140" height="220" cellpadding="0"
height="220" , invalid
cellspacing="1" oncontextmenu=\ "return false;\">\n';
"oncontextm enu" IE Win only, I believe, and a bad idea.
popCode+='<STYL E TYPE="text/css">\n';
popCode+='td {font-family: Tahoma, Arial, Helvetica,
sans-serif;font-size: 8pt;font-style: normal;border:1 pt solid
#CCCCCC; background:#CCC CCC;}\n';
8 pt?????? popCode+='.over {background:#33 66AF;color:#FFF FFF;border:1pt solid
#737B92}\n';
popCode+='<\/STYLE>\n';
popCode+='<scri pt type="text/javascript"
src="xTable.js" ><\/script>\n';
popCode+='<tr>< td'
popCode+=' onMouseover="cl assName=\'over\ ';"
this.className, surely?
onMouseout="cla ssName=\'\';" onClick="alert( \'' + Value +'\');">';
popCode+='Filte r op: '+Field+' is '+Value+'</td></tr>\n';
popCode+='<tr>< td';
popCode+=' onMouseover="cl assName=\'over\ ';"
onMouseout="cla ssName=\'\';" onClick="render Data(\'' + Field
+'\');">';
popCode+='Filte r op: '+Field+' is '+Value+'</td></tr>\n';
popCode+='</table>\n';
popCode+='<\/body>\n<\/html>\n';
var oPopupBody = oPopup.document .body;
oPopupBody.inne rHTML = 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(filt erField){
alert("Joepie hij doet 't!");
alert(filterFie ld);
}


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
4364
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 on another thumbnail instead, only IE replaces the enlarged pic by the new one, Firebird and Opera...
5
3964
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) {
38
5051
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 language="javascript"> <!-- window.open("256fx/index.htm", "", "height=400, width=600"); //-->
8
1955
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 intranet application. Bijoy
7
3213
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 left of the browser window rather than of the entire screen, unlike the other modern browsers I've...
2
5861
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 way to execute the function to edit the text in the richtext field. Download the test database from...
0
1264
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(); }
7
3660
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
2
3260
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 once, a white window the size of my webpage displays. I close it and click on the button again (for...
5
1959
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 white window the size of my webpage displays. I close it and click on the button again (for the same...
0
8345
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8768
jinu1996
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...
0
8633
tracyyun
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...
0
7368
agi2029
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...
0
4181
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...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
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
2
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1754
bsmnconsultancy
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...

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.