Rohit Bajaj
asked on
Whether to pass a javascript object to a function or id
HI,
I am making a search filter...
And how i am intending it to give it to user... is ...like :
user will provide the following html in its file :
<div id="filter"/>
And then in js will invoke my library with the parameter filter
And my code will replace this div with the search filter html and everything else....
Now there is an alternative approach to this :
User can create a $('#filter') and pass it to my function or any other javascript object DOM Node etc...
Which approach is better passing the id as a string or passing an object... and which one....
Also the search filter html which i will return should append to this div element or replace this element ?
Thanks
I am making a search filter...
And how i am intending it to give it to user... is ...like :
user will provide the following html in its file :
<div id="filter"/>
And then in js will invoke my library with the parameter filter
And my code will replace this div with the search filter html and everything else....
Now there is an alternative approach to this :
User can create a $('#filter') and pass it to my function or any other javascript object DOM Node etc...
Which approach is better passing the id as a string or passing an object... and which one....
Also the search filter html which i will return should append to this div element or replace this element ?
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.