0

I have a specific situation. I hope you can help me..

I have two different html pages. I am parsing them and regenerating them as a single html page with Java. Each page contains many JavaScript functions and some of them have exactly the same function signature.

The problem is that I should not make any changes on the function definitions that I am parsing from that two different pages.

So, lets say Page A has

function showMessage(){
alert("Page A");
}

Page B has

function showMessage(){
alert("Page B");
}

When I parse them, function definitions should stay as they are.

I tried to create namespaces for each page's JavaScript functions in the single HTML page and I tried to use object literals. But I should not make any changes in the function definitions. So, following code does not help me..

var NS1 = {
    showMessage: function() {

        alert("workss");
    }
}

Do you have any idea how i can solve this issue?

Thank you for your help..

GuneyK
  • 1
  • 2

0 Answers0