M
michaeloder
I was working on a project recently in which a client needed to
include check content entered by a user on one site against a database
hosted on a different site under a different domain. The ideal
solution was AJAX but that was ruled out because of the cross-domain
issue. Iframes would have worked for displaying the result but would
have been very clunky and would allow any client-side processing of
the data on the original site. Script inclusion could include the
remote data but wouldn't be dynamic plus it has the added risk that if
the foreign server is unavailbale Internet Explorer will not show the
original page at all.
I came up with the idea of dynamically adding script tags to the
document to get around this limitation. Checking around a I found a
couple of sites that implemented the technique, but I had never heard
of it before. Considering that this techniques provides a simpe but
effective method of cross-domain communiction, I would have thought it
would have been a common item in JavaScript developers' toolkits. To
provide a simpler name for people to reference than Dynamic Script
Attachment, I propose naming the technique Hermes after the Greek
messenger of the Gods.
For a code samples and an explanation of the technique see:
http://www.tomorrownext.com/hermes/
For a variety of simple demos see:
http://www.tomorrownext.com/hermesdemo/
Let me know what you think.
include check content entered by a user on one site against a database
hosted on a different site under a different domain. The ideal
solution was AJAX but that was ruled out because of the cross-domain
issue. Iframes would have worked for displaying the result but would
have been very clunky and would allow any client-side processing of
the data on the original site. Script inclusion could include the
remote data but wouldn't be dynamic plus it has the added risk that if
the foreign server is unavailbale Internet Explorer will not show the
original page at all.
I came up with the idea of dynamically adding script tags to the
document to get around this limitation. Checking around a I found a
couple of sites that implemented the technique, but I had never heard
of it before. Considering that this techniques provides a simpe but
effective method of cross-domain communiction, I would have thought it
would have been a common item in JavaScript developers' toolkits. To
provide a simpler name for people to reference than Dynamic Script
Attachment, I propose naming the technique Hermes after the Greek
messenger of the Gods.
For a code samples and an explanation of the technique see:
http://www.tomorrownext.com/hermes/
For a variety of simple demos see:
http://www.tomorrownext.com/hermesdemo/
Let me know what you think.