Jayapal Chandran
Jayapal Chandran

Reputation: 11140

JavaScript object oncreate event like in win32 api programming - is it possible

I want to monitor object creation. For example, I want to dynamically change some https links to http using JavaScript. I can do it in the page onload event by fetching all object anchors and can replace the href, but I want to do that at the instance of the object creation instead of waiting till the page has loaded. So to prevent users from clicking any link which had already appeared at the top of the page and if the page is taking some time to load then the URL would have had replaced to my desired path. so that is the reason I want to change the href to a different URL or replace https to http.

I haven't heard or read about on create event so I am posting it here. People should have alternatives or other options which we have not yet heard, read or used.

Upvotes: 0

Views: 1068

Answers (1)

elmac
elmac

Reputation: 228

Are you sure JavaScript is the right way to go here? Don't you have access to the server side, to just change the links there? Because users with JS disabled would still see and use https, I don't think you should tackle the problem using JS.

Upvotes: 2

Related Questions