Current location: Hot Scripts Forums » General Web Coding » JavaScript » help calling a JAvascript function


help calling a JAvascript function

Reply
  #1 (permalink)  
Old 02-11-06, 08:40 AM
sharijl's Avatar
sharijl sharijl is offline
Newbie Coder
 
Join Date: Nov 2005
Location: North Carolina
Posts: 86
Thanks: 1
Thanked 1 Time in 1 Post
Question help calling a JAvascript function

I am trying to update my phpbb forum with a sidebar using the XPwidget script from dhtmlgoodies.com found here found here.

I have put the appropriate scripting in the body and header as indicated but the javascript is the problem because all I get is a blue column with some text.

according to the site I need to "call the function "initDhtmlgoodies_xpPane" to initialize the panes." In the details there is an example:

<script type="text/javascript">
/*
Arguments to function
1) Array of titles
2) Array indicating initial state of panels(true = expanded, false = not expanded )
3) Array of cookie names used to remember state of panels
*/
initDhtmlgoodies_xpPane(Array('File and Folder Tasks','Other places','Details'),Array(true,true,false),Array('p ane1','pane2','pane3'));
</script>


but I don't know how to do this. I tried adding that scrip below the HTML and it is not working. How do I call the javascript to bring the page to life? (do I need to create a java file separate from my html page or is there something I need to add to the html page?)
Reply With Quote
  #2 (permalink)  
Old 02-11-06, 01:51 PM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
To call a function in JavaScript, you simply do functionName(argument1,argument2,argument3,...).

As the help says on the page, you need to send three arrays as arguments to the function initDhtmlgoodies_xpPane.
These shuld be in the form of arrays, which is what the Array(...) parts are for.
The first array contains all the names for your panels. I assume that the first name corresponds to the first <div> element with the class dhtmlgoodies_panel.
The second array contains the state of these panels. The length of this array must probably be the same as the length of the first array. So specify true or false for each one of your panels.
The third array is used if you want to use cookies to make the panels remember if the user left them open or not when leaving the page.

Then just add the piece of code you posted (with your arguments instead of the example of course) to the end of your content inside the <body> tag. That will make the browser parse the script, execute the function, which in turn will use the arguments you supplied to render the panels.

It's all in the page you linked to. If you want more detailed help, there's not much anyone can do without seeing your code. Otherwise there's no way of knowing what's missing.
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Reply With Quote
  #3 (permalink)  
Old 02-11-06, 07:21 PM
sharijl's Avatar
sharijl sharijl is offline
Newbie Coder
 
Join Date: Nov 2005
Location: North Carolina
Posts: 86
Thanks: 1
Thanked 1 Time in 1 Post
thanks for helping

thanks for your comments. I guess over all I just did not understand all the information that was provided on the site. I am going to go thorugh the links you provided and read up a little on javascript then I am sure it will click. If you say it is all there.
Reply With Quote
  #4 (permalink)  
Old 02-12-06, 01:31 PM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
No problem. It takes a while to get used to thinking in certain patterns, you'll get the hang of it soon.
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP upload prob minority ASP 1 06-27-05 08:35 AM
Is it possible 2 stop a javascript function w/ other jv command? noni JavaScript 1 01-19-05 11:48 AM
PHP Error Fairnie PHP 8 06-26-04 07:15 AM
Disable form fields to be submitted RickyRod JavaScript 2 05-24-04 10:15 AM
Help trim code down TheLaughingBandit JavaScript 0 09-02-03 09:50 AM


All times are GMT -5. The time now is 11:03 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.