logo

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

  1. Thanks for that one, it's always the little simple things that usually are the most useful and save the time.

  2. Hey, that's really usefull! Thanks!

  3. 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.

    • avatar
    • 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.

    • avatar
    • 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.

  4. Nice post. Very useful. I especially like the first line...

    • avatar
    • Vimal
    • Tue 23 Jan 2007 08:43 AM

    Cool. That is really handy. Thanks Jake.

  5. 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.

    • avatar
    • Chris
    • Tue 23 Jan 2007 10:00 AM

    I totally forgot about this feature. Good tip!

  6. "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 ...

  7. 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)

  8. @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)

    • avatar
    • Jay
    • Tue 23 Jan 2007 03:18 PM

    Clearly the end of my nightmare. Working with some DXL forms and was a pain in scenarios like these. Thanks!

    • avatar
    • 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).

    • avatar
    • 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?)

    • avatar
    • 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 :)

    • avatar
    • Axel
    • Wed 24 Jan 2007 04:36 AM

    being not very daily moves interested myself, I sincerely enjoyed reading {Link}

    and

    wissel.net (as each year).

  9. impressively useful for daily work.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Tue 23 Jan 2007

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

Elsewhere

Here are the external links posted on the same day.

More links are available in the archive »

More Content