teng84 Posted May 4, 2011 Share Posted May 4, 2011 Im not sure what does it mean Search.prototype.getSearch= function(Url){ } i cant figure out how does it work and how to alter please help Quote Link to comment https://forums.phpfreaks.com/topic/235472-what-does-it-mean/ Share on other sites More sharing options...
gizmola Posted May 4, 2011 Share Posted May 4, 2011 Well Search is a javascript class which has been declared previously someplace with function Search() { } That code is using the "prototype" keyword to add a getSearch() method to the Search class, as well as any objects of Search that might have been instantiated. Javascript lets you do that. At some point I you could have code like this someplace: asearch = new Search(); asearch.getSearch('http://www......'); Quote Link to comment https://forums.phpfreaks.com/topic/235472-what-does-it-mean/#findComment-1210261 Share on other sites More sharing options...
teng84 Posted May 4, 2011 Author Share Posted May 4, 2011 thanks for the response but when i have this Search.prototype.getSearch= function(Url){ } is this function run when page load? or it take some function call to trigger this function? Quote Link to comment https://forums.phpfreaks.com/topic/235472-what-does-it-mean/#findComment-1210295 Share on other sites More sharing options...
trq Posted May 4, 2011 Share Posted May 4, 2011 You would need to call the function via the Search object. Whether or not that is done on page load would be up to you I suppose, I'm not sure it would make sense to do so. Quote Link to comment https://forums.phpfreaks.com/topic/235472-what-does-it-mean/#findComment-1210320 Share on other sites More sharing options...
teng84 Posted May 5, 2011 Author Share Posted May 5, 2011 thanks again for the response Quote Link to comment https://forums.phpfreaks.com/topic/235472-what-does-it-mean/#findComment-1210689 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.