Skip to main content
11 events
when toggle format what by license comment
Feb 7, 2018 at 18:06 comment added Muhammad Omer Aslam yes i agree i was not talking about the .html() that should be where you advised but just the "foo": <h1 id="title">Page-Foo</h1></div> to be "foo": function() {return "<h1 id="title">Page-Foo</h1></div>"} so that if he wants to do something else or render via Mustache he can process and return the resulting html, but the $("#main").html() will remain where you suggested.
Feb 7, 2018 at 18:03 comment added Sᴀᴍ Onᴇᴌᴀ One could still remove the calls to .html() from each object property even if the strings were delimited by single- or double-quotes... if one used Mustach.js to render templates, that could perhaps be added (conditionally) right before the one call to .html()
Feb 7, 2018 at 17:53 comment added Muhammad Omer Aslam just one thing more rather than removing the function call from the object literals should'nt it be better to keep it that way, because if I replace the backtick with a single quote and use the Mustach.js to render my templates and then I would have to return the HTML after rendering, because i think @Ben has a reasonable reason to replace the backticks with single or double quotes
Feb 7, 2018 at 17:39 history edited Sᴀᴍ Onᴇᴌᴀ CC BY-SA 3.0
add explanation about moving function call out of each object property
Feb 7, 2018 at 17:37 comment added Muhammad Omer Aslam Haha obviously not OP's code at least I am used to StackOverflow rules that much :D, i wanted to just know if i can update the code in my own post according to the suggestions you both gave me, thanks for informing.
Feb 7, 2018 at 17:33 comment added Sᴀᴍ Onᴇᴌᴀ Do you mean you want to update (the code in) your answer? If so, there should be a link below it on the left side (see this)... otherwise if you mean the OPs code then know that it should not be updated, lest our answers be invalidated
Feb 7, 2018 at 17:28 comment added Muhammad Omer Aslam I have been on StackOverflow for quite some time but as I told you that this was my first review so wanted to ask that if I could update the answer according to the suggestions by referring you and Ben both about the points you raised and change the code or I cannot? we can do that on StackOverflow but don't know about code review if it is allowed or not ?
Feb 7, 2018 at 17:16 history edited Sᴀᴍ Onᴇᴌᴀ CC BY-SA 3.0
add example of constant
Feb 7, 2018 at 17:13 comment added Muhammad Omer Aslam i definitely missed these 2 things you mentioned above all moving the $('#main').html() outside is way better approach than the way i used. thanks for the heads-up. it was the first ever review i submitted so am all ears to suggestions.
Feb 7, 2018 at 16:54 history edited Sᴀᴍ Onᴇᴌᴀ CC BY-SA 3.0
add links
Feb 7, 2018 at 16:49 history answered Sᴀᴍ Onᴇᴌᴀ CC BY-SA 3.0