« Four Reasons To Upgrade to Domino 7.0.2 | Blogs | Developing for the Blackberry »
Tip: Quick Escape Quotes
Here's a tip you might find a little more useful than the daily movements of people in Orlando.
Whenever I see something I like on a webpage and I want to recreate it in Domino the first thing I do is view-source and paste the links to the required files in to the HTML Head Content of a new form, like so:

You now have the job of escaping all the "s with \s, which might not take that long but is a boring tedious task. An easier way is to enclose the whole lot in {}s. like so:

Now, save and close the form. When you re-open it you'll see the job's been done for you:

If you want to tidy things up all you need to do is put some new lines in:

Comments
Graham Tucker (Tue 23 Jan 2007 05:32 AM) website / e-mail
Thanks for that one, it's always the little simple things that usually are the most useful and save the time.
Fredrik Stöckel (Tue 23 Jan 2007 06:07 AM) e-mail
Hey, that's really usefull! Thanks!
Fabian Robok (Tue 23 Jan 2007 07:04 AM) e-mail
You managed to show this feature in a positive light. All who accused you of slamming Domino should take note of that.
Personally, I always rather considered the curly brackets to be broken. After all, there's no value in itself to escaping each and every quote. It would be a heck of a lot easier if Notes would simply keep the curly brackets instead of converting the whole string.
But for whatever reason, that only works in comments.
Nick Wall (Tue 23 Jan 2007 07:56 AM)
FYI. You don't need to save and close the form...just moving the focus from the developer pane to a different field or form event, then go back to the field, form HTMLHead, field, computed text etc, will make designer put escape quotes in.
Jake Howlett (Tue 23 Jan 2007 08:07 AM)
Thanks Nick. For some reason I thought I'd tried that and found it never worked. Just tried again and it did. Weird.
Corey Kimball (Tue 23 Jan 2007 08:08 AM) e-mail
Nice post. Very useful. I especially like the first line...
Vimal (Tue 23 Jan 2007 08:43 AM)
Cool. That is really handy. Thanks Jake.
Michael (Tue 23 Jan 2007 09:09 AM) e-mail
You can save yourself some typing entirely if the js is filed in the Shared Code - Script Libraries section. In the form's code pane for JS Header, right click and select 'Insert Resource'. You end up with a nicely labelled button versus the 'no tool tip' icon if you inserted the resource in the page directly.
I usually use a shared field titled HTMLHEAD and just enter that into the form's HTML Head Content.
btw... you can use the right-click method for the HTML Header Content and insert a css reference which leaves a button as well.
Chris (Tue 23 Jan 2007 10:00 AM)
I totally forgot about this feature. Good tip!
Fabian Robok (Tue 23 Jan 2007 10:21 AM) e-mail
"btw... you can use the right-click method for the HTML Header Content and insert a css reference which leaves a button as well."
Plus, this generates valid HTML, contrary to inserting the CSS resource as an "icon" in the form ...
Adibabu Kancharla (Tue 23 Jan 2007 10:43 AM) e-mail
Jake,
You can simplify it further by using formula language permulated operations.
@Implode({<script type='text/javascript' src="} *+ "yahoo.js" : "event.js" : "dom.js" *+{"></script>};@NewLine)
Michael (Tue 23 Jan 2007 02:03 PM) e-mail
@Adibabu
I guess that depends on your definition of simplicity. Don't hold back, go all the way:
@Implode({<script type='text/javascript' src="} *+ "yahoo" : "event" : "dom"+".js" *+{"></script>};@NewLine)
Jay (Tue 23 Jan 2007 03:18 PM) website / e-mail
Clearly the end of my nightmare. Working with some DXL forms and was a pain in scenarios like these. Thanks!
Peter LaComb (Tue 23 Jan 2007 07:25 PM)
1) Cool - that saves me from silly stuff like ctrl+H in Notepad
2) Cool - Something to read that isn't the semi-functional, yet always bringing my browsers (FF, IE, Opera) to it's knees, lotusPherelive.com (emphasis on the Pee they used in building that site).
Peter LaComb (Tue 23 Jan 2007 07:33 PM)
I do have to agree w/ Fabian - I sometimes wish this functioned more like LS. I'm not sure why, but I find it easier to count double pipes than double-double quotes:
|| vs. ""
{<tag attribute="value"></tag>} seems clean enough to me.. especially when the value has slashes or other escaped characters.
@Michael - if you're going to go that far, you may as well put a checkbox field on the form that lists JS files in a view, and then @implode the results... would make per-page JS quite easy to pull off. but then, that was probably obvious (why else would I have thought of it?)
carcomaidon (Wed 24 Jan 2007 02:41 AM)
It is a nice tip. And the opposite also happens. I realized about that a while ago: If you have a piece of code like "<script text =\"text/javascript\" src=\"prototype.js\"></script>" in your $$HTMLHeadContent field (for example), and you want to coment it out with REM ...it also does the job for you and removes the backslashes. Then, if you want to uncomment, you have 2 choices:
- 1. Remove the REM, {} and add the lost backslashes.
- 2. Just remove the REM :)
Axel (Wed 24 Jan 2007 04:36 AM) e-mail
being not very daily moves interested myself, I sincerely enjoyed reading {Link}
and
wissel.net (as each year).
starrow (Mon 7 May 2007 06:23 AM) website
impressively useful for daily work.
Add your response here:
