I want to write a JavaScript that either ignores all onclick link references found in the text of the page file, or does a search and replace whereby the following string is found and replaced with nothing.
onclick="popupEvent
BACKGROUND:
I'm using a third-party calendar program. The program is designed to produce both a mouseover, "title" window, and an onclick, pop up window tied to dates where events are scheduled. The calendar view I'm using produces a mini, month-at-a-glance view.
My web site has both a member (private) and public section. I want the onclick feature active in the member section, but don't want it to work in the public section . The public calendar is used to show non-members what great events they are missing by not being members, and is there to generate sales. All I want for the public calendar is the "title" window. Anything more would give away the farm, so to speak.
SET UP:
To insert one of the calendar's 4 views into any web page, you place the same two lines of code in the php file; one in the header, and one just below the <body> tag. Those set up the basic calls to display any calendar "views" you want to display. Then within the body of the page, you inset a line of code to call the calendar you wish, where you want it to show up. It is that simple.
The source code that makes up the final, displayed calendar page is a combination of the original code, and that code inserted from multiple php files from which it was called. That "called" code includes the onclick link references. What I want to do is insert a master or global java script into the "parent" pages, that ignores any and all onclick commands that may have been inserted there, or replaces them with nothing - effectively disabling them.
I am using two separate files (web pages) to display this calendar; one in the public section and one in the private section. The challenge is that the calendar software isn't set up to allow the popup to be turned off and on at the file (page) level, just globally for "all" pages. If it did I could have the global feature "on" and turn off the pop up on the public page just by adding a line of code. But, alas, no luck. Please note... the calendar's documentation / support forum does provide some on/off code strings, just not for this pop up.
To make one of my calendars private, I've copied that file (with calendar code inserted as indicated above) into a secure folder on my server. The other page lives in a separate, non-secure (public) directory. Both pages call the same calendar, but are different web page files stored in different directories.
I spent two days hacking and testing the calendar's php-based, program files to try to circumvent this process, but just no luck. Primary reason is that a few of the pages are scrambled so they can't be hacked, therefore I cannot modify them.
That leaves me with trying to disable the onclick references in the my public file, and here I am.
Suggestions?
Thanks in advance.
Barbara