?
Solved

Call overLIB url from XML as external function?

Posted on 2010-08-20
3
Medium Priority
?
444 Views
Last Modified: 2012-05-10
I'm working on an AnyGantt application and am trying to find a way to call overLIB as an external function that is launched when an object is clicked on the Gantt chart. AnyGantt is xml based and supports two click event actions: NavigateToURL and Call. NavigateToURL cannot be used because the overLIB URL would have to be entered in CDATA notation, and that notation cannot be used for attributes in XML, which leaves the Call function.

Can anybody suggest, with a simple example if possible, a way to embed an overLIB call in an external js function so that the AnyGantt xml could use something like

<action type="call" event="click" function="[name of overlib JavaScript function]" />

?

If it is possible in principle to do this, I'm not sure what the js function containing the overLIB call would look like.
0
Comment
Question by:dgmoore1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
3 Comments
 

Accepted Solution

by:
dgmoore1 earned 0 total points
ID: 33523870
After some experimentation and consultation with overLIB expert Robert Boughner I have found that it is indeed possible to execute an overLIB call in a JavaScript function. Just put the overLIB call, minus the html, in the function, using the required overLIB syntax/punctuation:

<script type="text/javascript" language="javascript">
function ol()
{
return overlib('<a href=\'http://www.bosrup.com/web/overlib/\'>Popups by overLIB</a>', RELX, 200, RELY, 400, STICKY, CAPTION,'Sticky!');
}
</script>

The ol() function executes when called by the external event and returns a popup as specified in the overLIB call. The only difference is that in this scenario overLIB does not know where the cursor is, so the popup will not be automatically displayed next to the cursor. This can be handled by using RELX, RELY in the overLIB call to specify a display location for the popup.
0
 

Author Comment

by:dgmoore1
ID: 33523883
After some experimentation and consultation with overLIB expert Robert Boughner I have found that it is indeed possible to execute an overLIB call in a JavaScript function. Just put the overLIB call, minus the html, in the function, using the required overLIB syntax/punctuation:

<script type="text/javascript" language="javascript">
function ol()
{
return overlib('<a href=\'http://www.bosrup.com/web/overlib/\'>Popups by overLIB</a>', RELX, 200, RELY, 400, STICKY, CAPTION,'Sticky!');
}
</script>

The ol() function executes when called by the external event and returns a popup as specified in the overLIB call. The only difference is that in this scenario overLIB does not know where the cursor is, so the popup will not be automatically displayed next to the cursor. This can be handled by using RELX, RELY in the overLIB call to specify a display location for the popup.
0
 

Author Closing Comment

by:dgmoore1
ID: 33523910
This solves the problme
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question