Ask a Question related to Macromedia Exchange Dreamweaver Extensions, Design and Development.
-
drerolf #1
problem to insert script
Hi outthere, I made an extension which inserts a piece of javascript into the
source, including: <script>...</script> and <noscript>...</noscript>. By using
this extension in codeview everything works fine. Here comes the problem: In
the designview the script maybe is inserted between an open <p> tag. If now the
user is writing something, he'll writes it into the <noscript></noscript> area
and not after the hole piece of JS which has been pasted into the code. How
can I avoid this? Hope you know what I mean... CU, drerolf
drerolf Guest
-
Insert NULL not Blank into MySQL with PHP Script
Hi, Here's my question: How do I pass a NULL value in a variable to a MySQL DB? Here's an overview of my problem: I have a PHP page that... -
Insert data in DB by using the script
Hi, I have an sql script (generated by php) which contains only INSERT commands. The sql script should be launched everyday in order to insert... -
' & insert problem
Hi, Whats the best way to handle clients submitting ' in form fields i.e. richard's would throw an error when using sql to insert into the... -
Problem with insert
I have the following code in an ASP page that is processing a form to create a new user. I keep getting the following error Microsoft JET... -
multiple insert problem !
hi ! had to come right back... this time i'm trying to do a multiple insert. in my admin website i want to add users to a specific project. i... -
danilocelic *TMM* #2
Re: problem to insert script
drerolf wrote:
How are you diong the insert?> Hi outthere, I made an extension which inserts a piece of javascript into the
> source, including: <script>...</script> and <noscript>...</noscript>. By using
> this extension in codeview everything works fine. Here comes the problem: In
> the designview the script maybe is inserted between an open <p> tag. If now the
> user is writing something, he'll writes it into the <noscript></noscript> area
> and not after the hole piece of JS which has been pasted into the code. How
> can I avoid this? Hope you know what I mean... CU, drerolf
It may be possible to insert your code, and place the insertion point after the noscript block. However, I don't think you will be able to prevent folks from being able to type in that location later.
--
Danilo Celic
| Extending Knowledge Daily : [url]http://CommunityMX.com/[/url]
| Team Macromedia for Dreamweaver : [url]http://macromedia.com/go/team/[/url]
danilocelic *TMM* Guest
-
drerolf #3
Re: problem to insert script
Thanks for your reply, The script is inserted in place (cursor position) via
the objectTag(). The cursor should stay after: <script>...</script> and
<noscript>...</noscript> HERE. Design-view can't show javascript, so it shows
the text between the noscript e.g.: 'JS is disabled'. Cursor stands after
'disabled'. Changing to codeview shows the same result - cursor stands after
'disabled' and not after the </noscript> tag. If now the user inserts some
text, he writes it between the <noscript>...</noscript> You wrote: >However, I
don't think you will be able to prevent folks from being able to type in that
location later. They could do what they want, but those who hasn't much
experience are writing between <noscript>...</noscript>... , but I mentioned
that already. ;-) Any ideas? Thanks a lot. drerolf
drerolf Guest
-
danilocelic *TMM* #4
Re: problem to insert script
drerolf wrote:
Try using insertObject(), rather than objectTag(), with code similar to the following:> Thanks for your reply, The script is inserted in place (cursor position) via
> the objectTag(). The cursor should stay after: <script>...</script> and
> <noscript>...</noscript> HERE. Design-view can't show javascript, so it shows
> the text between the noscript e.g.: 'JS is disabled'. Cursor stands after
> 'disabled'. Changing to codeview shows the same result - cursor stands after
> 'disabled' and not after the </noscript> tag.
function insertObject(){
var objectCode = '<script>...</s' + 'cript><noscript>...</nos' + 'cript>';
var dom = dw.getDocumentDOM();
dom.insertHTML(objectCode);
return '';
}
When that is run, it inserts the block of code and it is hightlighted. If they immediately type it will wipe out the addition, as is true of any selection. If they arrow off the selection to the left, they will be placed before the opeing of the <script> tag, and it they arrow off to the right, they will be after the closing </noscript> tag.
Note: I'm breaking up the closing tags becuase 1) you have to for the closing script tag as DW will think its the close of the containg script block, and 2) thought it would be safe to do the same with te noscript, but maybe not required.
--
Danilo Celic
| Extending Knowledge, Daily [url]http://CommunityMX.com/[/url]
danilocelic *TMM* Guest
-
drerolf #5
Re: problem to insert script
Hi danilocelic, Thanks a lot for your help. I nearly stopped working on this
extension. But now: It works perfectly! I'm not sure if changing objectTag()
or insertObject() was the point. What I've been ignored was breaking up the
closing tags. (foolish mistake) Maybe that was the point. Your help is very
much appreciated. Well, have a beer from me (someday, if we meet ;-) ! CU,
drerolf
drerolf Guest



Reply With Quote

