Including inline javascript code OR link to JS file

We have some use cases, for which we want to allow authors/publishers to specify inline javascript OR link to a JS file on a CQ page. We enabled source editing mode for Rich Text Editor (using misctools plugin).
Now I can enter HTML including <SCRIPT> tags in the rich text editor. But the problem is richtext validation checker strips out Javascript automatically. Is there any way to turn off this validation and stop stripping off of javascript?
Is there any other way that we can directly enter javascript to CQ pages?

If your concern is only related to how you can insert javascript on page through user interaction (i.e. component authoring) then probably you can use textarea (xtype) instead richtext, if it solves the purpose.

Similar Messages

  • JavaScript code was missing (Configurator 2 file to 3)...

    Hi Everyone...
    I just opened a Configurator 2 file in the new 3.1 and converted it to CS6.  Now I'm getting a "JavaScript code was missing" error when I attempt to run 'Image Processor' and 'Load files into stack' scripts.  These were working just fine previously.  Unfortunately we don't have an older backup of the Configurator 2 file.
    Does anyone know of a fix for this?  A quick online search discussed a possible issue with the hard drive sharing the same name as something or other.  I can't see how it worked before and doesn't work now.  The only thing we did was open it in the latest version and convert to CS6.
    Note: We have even tried removing the old button and have replaced it with the new Configurator 3 buttons.  Still doesn't work.
    Very frustrating... and yes, it's my fault I didn't have a backup of the original Configurator 2 file.

    You know... sometimes I just want to scream. 
    So after further digging I discovered, to my wonderment, that the two scripts in question have been effectively omitted (turned off).  Could someone at Adobe please explain to us why they would do this?  Pehaps you might want to put 'Several Features Not Available' in big bold letters on the download page before people like myself go downloading the latest and greatest only to have their workflow stunted by a clear flaw in the system.  One could safely believe that at the very least, all of the features of the previous Configurator versions would be present and working in the latest release.
    Things like this add to my ever-decreasing loss of faith in mankind. 
    See below for the scripts that don't work... taken from the 'Known Issues' section of the Configurator 3.1 notes.  I'll be sure to always read the 'Known Issues' notes from now on, even though we shouldn't have to.
    [Photoshop CS6] The following HTML links to scripts do not work: [3167031]
    All of the Panel/Brush Presets section; adobe://photoshop.cs6/Panel/BrushPresets/[Close |
    CloseTabGroup | DeleteBrush | LoadBrushes | RenameBrush | ReplaceBrushes | ResetBrushes |
    SaveBrushes]
    All of the Panel/Brushes section; adobe://photoshop.cs6/Panel/Brushes/[ClearBrushControls |
    CopyTexturetoOtherTools | NewBrushPreset]
    All of the Panel/ChannelMixerAdjustment section;
    adobe://photoshop.cs6/Panel/ChannelMixerAdjustment/[Close | CloseTabGroup |
    DeleteCurrentPreset | LoadChannelMixerPreset | ResetChannelMixer | SaveChannelMixerPreset] and
    adobe://photoshop.cs6/Panel/ChannelMixerAdjustment/Auto/SelectParameter
    adobe://photoshop.cs6/Main/File/Print
    adobe://photoshop.cs6/Main/File/PrintOneCopy
    adobe://photoshop.cs6/Main/File/Scripts/ImageProcessor
    adobe://photoshop.cs6/Main/File/Scripts/LoadFilesintoStack
    adobe://photoshop.cs6/Main/File/Scripts/Statistics
    [Windows only] adobe://photoshop.cs6/Main/3D/GetMoreContent

  • Javascript code missing when inserting Fireworks html into DW document

    I tried to insert fireworks html in a Dreamweaver file. After importing the fireworks html in the Dreamweaver document, the associated Javascript code was missing.
    Of course, the Fireworks html file includes the Javascript code and works properly. It is just that when I insert the Fireworks html into the Dreamweaver file, the associated Javascript code gets lost although the manual clearly says that fireworks html is inserted "along with its associated images, slices, and JavaScript".
    I use Fireworks CS5 and Dreamweaver CS5, but I also tried it using FW CS4 and DW CS4 which did not solve the problem.
    I tried two ways to insert the html code (both with the same negative result):
    1.) using the DW menu: Insert > Image Objects > Fireworks HTML
    2.) Copying the HTML to the clipboard in Fireworks, and then pasting it into the Dreamweaver document
    The Fireworks and the Dreaweaver files are both HTML4 docs.
    Of course, I could insert the Javascript code manually, but then I would have to detach the associated template from the DW doc, and I would rather not do that because then later updates to the site will become more complicated.
    BTW, I also tried to insert the fireworks html in another Dreamweaver document not using any template, but the JavaScript code got lost though.
    I would be very grateful if somebody had an idea how to solve this  problem.
    Many thanks for your help!
    Siria
    Message was edited by: SiriaW

    Dear Murray,
    I believe you can solve your problem by changing this -
    </head>
    to this -
    <!-- #BeginEditable "head" --><!-- #EndEditable -->
    </head>
    by editing this template directly.
    I tried this, but it did not change anything. As I wrote before, the JavaScript code is not even inserted when I use a "blank", not-template-controlled DW page.
    But nevertheless, your hint is very helpful. By making the complete head editable, I can at least insert the Javascript code manually.
    But is the javascript that is currently shown there part of the FW HTML insertion?  Do you want to preserve that on the child pages?
    It belongs to the template. And yes, I want to preserve it on the child pages. I just want to insert this into the head of the child page:
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    Maybe we should see the FW code you are trying to insert?
    Sure. Here is the code I tried to insert (of course, most of the Java Script does not need to be inserted as it is already in the template):
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <!-- saved from url=(0014)about:internet -->
    <html>
    <head>
    <title>example.jpg</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <!--Fireworks CS5 Dreamweaver CS5 target.  Created Wed Jul 21 00:26:08 GMT+0800 (Malay Peninsula Standard Time) 2010-->
    <script language="JavaScript">
    <!--
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    function MM_nbGroup(event, grpName) { //v6.0
    var i,img,nbArr,args=MM_nbGroup.arguments;
      if (event == "init" && args.length > 2) {
        if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
          img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
          if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
          nbArr[nbArr.length] = img;
          for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
            if (!img.MM_up) img.MM_up = img.src;
            img.src = img.MM_dn = args[i+1];
            nbArr[nbArr.length] = img;
      } else if (event == "over") {
        document.MM_nbOver = nbArr = new Array();
        for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
          if (!img.MM_up) img.MM_up = img.src;
          img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])?args[i+1] : img.MM_up);
          nbArr[nbArr.length] = img;
      } else if (event == "out" ) {
        for (i=0; i < document.MM_nbOver.length; i++) { img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
      } else if (event == "down") {
        nbArr = document[grpName];
        if (nbArr) for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
        document[grpName] = nbArr = new Array();
        for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
          if (!img.MM_up) img.MM_up = img.src;
          img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
          nbArr[nbArr.length] = img;
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    //-->
    </script>
    </head>
    <body bgcolor="#ffffff" onLoad="MM_preloadImages('example_bilder/example_r2_c2_s2.jpg','example_bilder/example_r2 _c2_s3.jpg','example_bilder/example_r1_c4_s1.jpg','example_bilder/example_r4_c2_s2.jpg','e xample_bilder/example_r4_c2_s3.jpg','example_bilder/example_r1_c4_s2.jpg','example_bilder/ example_r6_c2_s2.jpg','example_bilder/example_r6_c2_s3.jpg','example_bilder/example_r1_c4_ s3.jpg','example_bilder/example_r8_c2_s2.jpg','example_bilder/example_r8_c2_s3.jpg','examp le_bilder/example_r1_c4_s4.jpg','example_bilder/example_r10_c2_s2.jpg','example_bilder/exa mple_r10_c2_s3.jpg','example_bilder/example_r1_c4_s5.jpg');">
    <table style="display: inline-table;" border="0" cellpadding="0" cellspacing="0" width="915">
    <!-- fwtable fwsrc="lebenslauf_inhalt_slices_optimiert.png" fwpage="Page 1" fwbase="example.jpg" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="1" -->
      <tr>
       <td><img name="example_r1_c1_s1" src="example_bilder/example_r1_c1_s1.jpg" width="58" height="274" border="0" alt=""></td>
       <td><table style="display: inline-table;" align=""left" border="0" cellpadding="0" cellspacing="0" width="195">
          <tr>
           <td><img name="example_r1_c2_s1" src="example_bilder/example_r1_c2_s1.jpg" width="195" height="68" border="0" alt=""></td>
          </tr>
          <tr>
           <td><a href="javascript:;" onMouseOut="MM_nbGroup('out');" onMouseOver="MM_nbGroup('over','example_r2_c2_s1','example_bilder/example_r2_c2_s2.jpg',' example_bilder/example_r2_c2_s3.jpg',1);" onClick="MM_nbGroup('down','navbar1','example_r2_c2_s1','example_bilder/example_r2_c2_s3. jpg',1);MM_swapImage('example_r1_c4_s1','','example_bilder/example_r1_c4_s1.jpg',1);"><img name="example_r2_c2_s1" src="example_bilder/example_r2_c2_s1.jpg" width="195" height="16" border="0" alt=""></a></td>
          </tr>
          <tr>
           <td><img name="example_r3_c2_s1" src="example_bilder/example_r3_c2_s1.jpg" width="195" height="14" border="0" alt=""></td>
          </tr>
          <tr>
           <td><a href="javascript:;" onMouseOut="MM_nbGroup('out');" onMouseOver="MM_nbGroup('over','example_r4_c2_s1','example_bilder/example_r4_c2_s2.jpg',' example_bilder/example_r4_c2_s3.jpg',1);" onClick="MM_nbGroup('down','navbar1','example_r4_c2_s1','example_bilder/example_r4_c2_s3. jpg',1);MM_swapImage('example_r1_c4_s1','','example_bilder/example_r1_c4_s2.jpg',1);"><img name="example_r4_c2_s1" src="example_bilder/example_r4_c2_s1.jpg" width="195" height="16" border="0" alt=""></a></td>
          </tr>
          <tr>
           <td><img name="example_r5_c2_s1" src="example_bilder/example_r5_c2_s1.jpg" width="195" height="15" border="0" alt=""></td>
          </tr>
          <tr>
           <td><a href="javascript:;" onMouseOut="MM_nbGroup('out');" onMouseOver="MM_nbGroup('over','example_r6_c2_s1','example_bilder/example_r6_c2_s2.jpg',' example_bilder/example_r6_c2_s3.jpg',1);" onClick="MM_nbGroup('down','navbar1','example_r6_c2_s1','example_bilder/example_r6_c2_s3. jpg',1);MM_swapImage('example_r1_c4_s1','','example_bilder/example_r1_c4_s3.jpg',1);"><img name="example_r6_c2_s1" src="example_bilder/example_r6_c2_s1.jpg" width="195" height="17" border="0" alt=""></a></td>
          </tr>
          <tr>
           <td><img name="example_r7_c2_s1" src="example_bilder/example_r7_c2_s1.jpg" width="195" height="14" border="0" alt=""></td>
          </tr>
          <tr>
           <td><a href="javascript:;" onMouseOut="MM_nbGroup('out');" onMouseOver="MM_nbGroup('over','example_r8_c2_s1','example_bilder/example_r8_c2_s2.jpg',' example_bilder/example_r8_c2_s3.jpg',1);" onClick="MM_nbGroup('down','navbar1','example_r8_c2_s1','example_bilder/example_r8_c2_s3. jpg',1);MM_swapImage('example_r1_c4_s1','','example_bilder/example_r1_c4_s4.jpg',1);"><img name="example_r8_c2_s1" src="example_bilder/example_r8_c2_s1.jpg" width="195" height="16" border="0" alt=""></a></td>
          </tr>
          <tr>
           <td><img name="example_r9_c2_s1" src="example_bilder/example_r9_c2_s1.jpg" width="195" height="15" border="0" alt=""></td>
          </tr>
          <tr>
           <td><a href="javascript:;" onMouseOut="MM_nbGroup('out');" onMouseOver="MM_nbGroup('over','example_r10_c2_s1','example_bilder/example_r10_c2_s2.jpg' ,'example_bilder/example_r10_c2_s3.jpg',1);" onClick="MM_nbGroup('down','navbar1','example_r10_c2_s1','example_bilder/example_r10_c2_s 3.jpg',1);MM_swapImage('example_r1_c4_s1','','example_bilder/example_r1_c4_s5.jpg',1);"><i mg name="example_r10_c2_s1" src="example_bilder/example_r10_c2_s1.jpg" width="195" height="16" border="0" alt=""></a></td>
          </tr>
          <tr>
           <td><img name="example_r11_c2_s1" src="example_bilder/example_r11_c2_s1.jpg" width="195" height="67" border="0" alt=""></td>
          </tr>
        </table></td>
       <td><img name="example_r1_c3_s1" src="example_bilder/example_r1_c3_s1.jpg" width="69" height="274" border="0" alt=""></td>
       <td><img name="example_r1_c4_s1" src="example_bilder/example_r1_c4_s1.jpg" width="539" height="274" border="0" alt=""></td>
       <td><img name="example_r1_c5_s1" src="example_bilder/example_r1_c5_s1.jpg" width="54" height="274" border="0" alt=""></td>
      </tr>
    </table>
    </body>
    </html>

  • OutputText executing Javascript Code

    [this forum|http://forums.oracle.com/forums/thread.jspa?threadID=897025]
    Hi everyone,
    I'm trying to include some javascript code to be executed when a jsff loads. In this sense, following the idea shown in this forum i wanted to include the script shown bellow:
    <af:outputText value="alert(&quot;in script&quot;);
    var x = document.getElementById(&quot;pg_scroll&quot;);
    x.scroll(0,0);"
    id="ot2"
    escape="false"/>
    (please, notice &quot; is the equivalent to ")
    The main idea is to retrieve the id of the element "pg_scroll" that is a PanelGroupLayout with its layout set to scroll, and the set the scroll to the Top using that javascript fuction. The reason is that when the page loads, the scroll goes directly to the bottom of the panelGroupLayout.
    When I tried it, the outputText is showing itself as it is. It is not executing the script. What am I doing wrong?
    Any suggestion, idea, workaround?
    Thank you very much!
    Rgds,
    Juanma.

    It worked, Sireesha!
    Probably it didn't work before because I was wrapping the script in a CDATA block... i don't know...
    Now struggling about how to retrieva a component I have in the jsff to set scrollTo(0,0)... I'm trying with AdfPage.PAGE.findComponentByAbsoluteId(_component_id_), but I don't know how to refer to the component.
    My PanelGroupLayout had id="pg_scroll", but
    var x = AdfPage.PAGE.findComponentByAbsoluteId("pg_scroll");
    x.scrollTo(0,0)
    didn't work.
    Any idea?

  • Javascript codes not working as they should in version 7

    I have a website that is working fine with version 3.6.9, now it is not working as it should be with version 7. My files containing javascript codes, the links in the codes are broken when am registering some controls using the <%@ Register .... /> tag.
    for example:
    i have the following code:
    <%@ Register Src="~/Controls/TempMenu.ascx" TagName="TempMenu" TagPrefix="uc1" %>
    now, whenever I click on any button in the page, instead of redirecting me to an existing page within the same folder, it will go to the "controls" folder and search for the page there...
    Please help.

    A good place to ask advice about web development is at the mozillaZine Web Development/Standards Evangelism forum.<br />
    The helpers at that forum are more knowledgeable about web development issues.<br />
    You need to register at the mozillaZine forum site in order to post at that forum.<br />
    See http://forums.mozillazine.org/viewforum.php?f=25

  • How to execute javascript code in VBScript?

    I'd like to execute similar javascript code for some particular PDF files(parameters for pagenumber are quite different),such as:
    this.setPageLabels(0, [ "A", "", 3] );
    this.setPageLabels(1, [ "r", "", 1] );
    this.setPageLabels(16, [ "D", "", 1] );
    How to write the code in VBScript?
    Thanks in advance!
    P.S. I try to add code but end up with error messages
    =================================================================
    path = "E:\test.pdf"
    '//Write the first and last pagenumbers and label to a txt.
    set oWs = CreateObject ("Wscript.Shell")
    set fs = CreateObject("Scripting.FileSystemObject")
    oWs.run "Acrobat.exe"
    While not oWs.AppActivate("Adobe Acrobat") : Wscript.Sleep 1000 : Wend
    Set objArgs = WScript.Arguments
    if objArgs.Count = 1 then path = ObjArgs(0)
    Set gApp = CreateObject("AcroExch.App")
    Set AVDoc = CreateObject("AcroExch.AVDoc")
    If (AVDoc.Open(Path,"")) Then
    Set AVDoc = gApp.GetActiveDoc()
    Set PDDoc = AVDoc.GetPDDoc()
    Set JSO = PDDoc.GetJSObject
    '// Write Bookmark JS to a variable
    Ex = " var vTOC = """"; "&vbLF _
    & " var s = """"; "&vbLF _
    & " var i=0; "&vbLF _
    & " p = i+1; "&vbLF _
    & " vTOC += ( this.getPageLabel(i) +""|""); "&vbLF _
    & " i= this.numPages-1 ; "&vbLF _
    & " p = i+1; "&vbLF _
    & " vTOC += ( this.getPageLabel(i) +""|""+p+""|""); "
    ' // Execute the JavaScript
    Set AForm = CreateObject("AFormAut.App") 'from AFormAPI
    AForm.Fields.ExecuteThisJavaScript EX
    ' // Write Bookmarks to CSV (PageNr;Level;Text)
    Set JSO = PDDoc.GetJSObject '//->renew JSO for some unknown reasons
    xf = jso.vToc
    Set objIE = CreateObject("InternetExplorer.Application")
    objIE.Navigate("about:blank")
    objIE.document.parentwindow.clipboardData.SetData "text", xf
    objIE.Quit
    CsvFN = left(path, InstrRev(path, ".")-1) &"_page.txt"
    set FL = fs.OpenTextFile(CsvFN, 2, true) '//-> 2=ForWriting
    xWr = split(xf,"|")
    for x=0 to UBound(xWr)
    FL.WriteLine xWr(x)
    next
    FL.Close
    Else
    MsgBox "Failed to Open: " & Path
    End If
    Set JSO = Nothing
    Set PDDoc = Nothing
    Set AVDoc = Nothing
    Set AForm = Nothing
    Set gApp = Nothing

    If I remember right, I wrote this script a while back to demonstrate how java script can be direct executed and how you can get back the results. Didn't I wrote a commentary to that?
    However the parts you need:
    ' // Write JS code from help file or whatever to a VBS variable:
    JsFromHelp = " this.setPageLabels(0, [ ""A"", """", 3] ); "&vbLF _
    & " this.setPageLabels(1, [ ""r"", """", 1] ); "&vbLF _
    & " this.setPageLabels(16, [ ""D"", """", 1] ); "
    ' // Execute the JavaScript
    Set AForm = CreateObject("AFormAut.App") 'from AFormAPI
    AForm.Fields.ExecuteThisJavaScript JsFromHelp
    From the rest keep only:
    end if
    set .. = nothing
    Untested, but should work - as far as you have a little bit more then only Reader.
    HTH, Reinhard

  • Acrobat crashed - can't enter Javascript code anymore!

    I just had Acrobat (8.1.2) crash on me while I was working on the Javascript code I had in the file. When I opened the file after the crash, the javascript code was empty - everything had been obliterated in the code module. And even when I enter new code and close the editor, when I try to open it again, it's empty again.
    I have Acrobat set to use an external app (I am using TextWrangler on a mac), so I don't know if that has any bearing on what happened, but the file now seems to be corrupted as any code I enter whether in an external app, or in the Acrobat javascript editor does not get saved. I tested the file on another computer, with the same results. Other files work properly on my computer.
    Is there any way to recover the code from the file? I had spent several hours on several parts of the code, and am not looking forward to having to recreate my work.

    Read "KT6-LSR and installing Windows on SATA" post (At this moment is the last in this page). There you'll find many posts about Raid problems.  8)

  • PDA: How does the VI in the "Calling External Code (Inline C Method)" example link to the called functions?

    The PDA module provides an example of calling external code via an inline C
    The inline source code from the example:
         OSVERSIONINFO info;
         info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
         Err = GetVersionEx(&info);
         MajorVersion = info.dwMajorversion;
         MinorVersion = info.dwMinorversion;
    The PDA build specification includes *no* additional source files of any kind.  The only source file in the build is the top-level VI.  Where are the definitions for the OSVERSIONINFO type, and the GetVersionEx function drawn from?
    The VI builds and runs fine on the PDA, but I don't understand how.

    Donovan B wrote:
    Hi Dan,
    It looks like there is an OSVERSIONINFO struct and GetVersionEx function available in the coredll.lib for the application to call on a PDA running Windows Mobile 5.0.  On both operating systems, it looks like the GetVersionEx function is defined in winbase.h, so I am not sure if there is some kind of linking between the two or if the header file is automatically included when building the executable or not.  Let me do some more research and I'll let you know.
    The information for the function on Windows Mobile can be found here.
    Message Edited by Donovan B on 12-19-2007 06:33 PM
    While the API functions are mostly the same for Windows Mobile and normal Windows the actual implementation and compilation is obviously not and there is no need for that. Windwos Mobile is typically (not sure if there are other versions at all) ARM based, while the desktop version is x86 based. A huge difference.
    And when LabVIEW creates a PDA executable it mostly creates a bunch of hidden C files, invokes the Visual C for Windows CE
    tool chain and lets it create the executable. The Visual C for Windows CE tool chain comes with its own import link libraries for accessing WinAPI functions and those import link libraries reference the functions in the DLLs as they are implemented for Windows Mobile (CE). There is no kernel32.dll in Windows Mobile and why should it? You can't move normal Windows code that would expect that DLL to Windows Mobile anyhow, since it has a completely different CPU and there is always a complete recompile with the Windows CE toolchain necessary anyhow.
    Rolf Kalbermatter   
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Using the rewriter to include javascript code on an external webpage

    -We are running Sun Portal Server 6.2
    -When users go to GOOGLE.COM through our gateway. I want the google page to be rewritten in such a way that it includes a piece of javascript code. (Written by me)
    In all the examples of the Sun documentation, I noticed only possibilities of rewriting tags so that it includes the gateway URL. Is it possible to actually replace a specific HTML tag with your own code or just even add code using the Sun Portal Rewriter service ???
    Anybody any clues ?

    I may have a (very bad) solution.
    You explode the /opt/SUNWps/libgateway.jar. In ressources subdir you have SRAPConvertSystem.js.
    It seems to be the javascript code the rewriter add at the beginning of the page.
    Try to edit the file, add some javascript at the end, redo the jar file and put it back in /opt/SUNps/lib.
    I did not try this. Maybe it's working, maybe not.

  • What is the javascript (this.maildoc) code to link mail icon in Acrobat X1

    What is the javascript (this.maildoc) code to link mail icon in Acrobat X1

    The code to use is:
    this.mailDoc();
    This will generate a blank email with the current email attached to it. If you want to specify additional parameters, like the address to send the email to, subject line, body message text, etc., have a look here:
    http://acrobatusers.com/tutorials/dynamically-setting-submit-e-mail-address
    Notice that this command does NOT actually send the email, it just generates it. It's still up to the user to press Send in their email application/website.

  • How do I code relative links as function parameters within Templates?

    I am a newcomer looking for best practices for a "How Do I?" properly code relative links as function parameters within an Adobe template (DWT) which accomodates page creation at 2 different level of folders. Dreamweaver doesn't appear to handle auto-correction of relative links as function parameters as far as I can see.  It's not clear to me what the best practice I should be following.  While this is not exactly a SPRY question, I am hoping that someone using the Spry.Data.XMLDataSet had already found the best practice to use.
    My Site
    -- Multiple pages at this level    and the parameter needs to be "_includes/UnitSideNavigation.xml"
    SubFolder
    -- Other pages at this level.       and the parameter needs to be "../_includes/UnitSideNavigation.xml"
    And this is the particular code snippet within a non edtable template area I would like to work for 2 levels of pages created from the template.
    <script type="text/javascript">
    var dsItems1 = new Spry.Data.XMLDataSet("_includes/UnitSideNavigation.xml", "/links/firstlevel");
    var dslinks = new Spry.Data.NestedXMLDataSet(dsItems1, "secondlevels/secondlevel");
    </script>
    My environment is Windows/Vista using latest CS4 dreamweaver.
    Any pointers appreciated. This is learn time for me. Hope I have made myself clear. Andy

    I use serverside includes instead of DWT for exactly that reason. Not only that, if you change anything within the template you must re-upload all of the files affected by the change; only the modified include file needs to be uploaded.

  • On file open: "This document contains JavaScript code for a widget that no longer exists."

    I had an existing, functional datepicker in a web page.
    Recently I downloaded the UI Datepicker in the Widget Browser and installed it in DW CS5. Now every time I load the file that calls the datepicker that I added myself, a warning opens with the following text:
    This document contains JavaScript code for a widget that no longer exists. If you don't remove the code, the browser might display JavaScript errors when loading the page. Would you like Dreamweaver to find all instances of this code for you?
    Widget: $("#reservDateBegin").datepicker();
    Widget: $("#reservDateEnd").datepicker();
    Clicking "Yes" opens the file and shows the search box at the bottom of the window with [current document] in File and $("#reservDateEnd").datepicker(); in Matched Text. Clicking "No" just opens the file.
    The error is wrong, since installing the widget is what caused the error in the first place!
    How can I get DW to stop showing this message?
    Thanks for any help.

    I do understand you're trying to be helpful. I was just hoping providing the relevant code snippets would be sufficient so I didn't have to take the time to provide a "cleaned" version of the files and upload those to a public-safe location.
    Zabeth69 wrote: If you don't understand what 'code at the bottom of the page' means, you have not used one of those systems. I don't know what causes the error code to come up (besides removing a Spry widget, I mean). So if it doesn't apply to you, ignore it.
    This is exactly my point: I haven't used any of the DW "systems". I've always manually coded in DW, so I can't have removed a Spry widget in the first place. It wasn't until I installed the Widget using the Widget Browser that I started getting the error (I don't mean adding the datepicker widget to the code using the DW Insert menu - I mean installing the Widget into DW itself). Ignoring such an erroneous/incorrect error seems kind of silly, since every time I open the file I get the error message.
    Anyway, as requested, the following are links to the contactUsCleaned.php page, and the php included headerCleaned.php file. Since these use php includes to complete the rendered HTML, they won't look right in the browser, but as you know viewing the source will show the relevant html, javascript, and jquery code. I didn't see any way to upload the files in this forum, which, due to the php code, would be preferable to see exactly what my code looks like...
    http://www.eventidewebdesign.com/public/contactUsCleaned.php
    http://www.eventidewebdesign.com/public/headerCleaned.php
    The footer.php file the contactUs page includes is simply a set of HTML links to the pages on the site, copyright info, and the Google Analytics script. There is no other code in the footer.php file.

  • Apex 4 - Javascript Code Editor??

    Hi,
    On the Apex 4 new features page , under additional new features (link below), one of the new features says "New Javascript code editor for use in the SQL and migration workshops".
    http://www.oracle.com/technology/products/database/application_express/html/4.0_new_features.html
    Can anybody tell me how you access this as I cant find it?
    Thanks.

    Hi,
    I think the way this feature is worded is possibly misleading you.
    Are you expecting a code editor in which you can edit your JavaScript code? Because if that is the case (which I think is a fair expectation given the current wording), then I'm afraid this is not what this feature is about. This actually relates to a new PL/SQL code editor available in these modules, which now includes syntax highlighting for your PL/SQL blocks. The word 'JavaScript' in the current description relates to the technology behind the editor, rather than the purpose of the editor, but that is misleading.
    I think it should be reworded to, 'New richer PL/SQL code editor available in SQL and Migration Workshops, including syntax highlighting' or similar. I will contact the relevant person in the team and get this updated.
    Apologies for the confusion.
    Regards,
    Anthony.

  • Simple javascript code?

    hello -
    i'm trying to insert some simple javascript into a flash file
    to test how it works.
    within the html file, i have this code:
    <script language="JavaScript">
    function mycallback(value) {
    alert("hello world! - " + value);
    </script>
    what should my action/javascript code look like in my flash
    file?
    here is just a html version of how i want it to work:
    http://www.dkwong.com/example_js.html
    thanks!

    Well, more the advanced features you need, you'll have to compromise somewhere! The code on the link I gave you is about 5KB. When you minify it, it is about 1.4KB.
    Copy the code, use http://jscompress.com/ to minify the code. Include it in your page then.
    -ST

  • How to use an if statement in javascript code

    Hello,
    I have a batch processing script to search for text "employee signature" on each page in a multiple page file and to then list in the console any pages that do not have the "Employee Signature" text included.
    The script is not yet functional as an if statement needs to be included.
    Can anyone please advise how to use an if statement in javascript code?
    var numpages = this.numPages;
    for (var i=0; i < numpages; i++)
    search.query("Employee Signature", "ActiveDoc");
    console.println('Pages that do not include an employee signature: ' + this.pageNum +' ');
    Any assistance will be most appreciated.

    Thank you very much for your assistance try.
    I have modified the code as suggested and the page numbers are now listing correctly, thank you, but....................,
    The console  lists every page as having an "employee signature" when there are pages in the document that do not have an employee signature.
    The code (revised as follows) is not processing the "getPageNthWord part of the statement" in the console report?
    Can you please advise where the code needs reworking?
    var ckWords; // word pair to test
    var bFound = false; // logical status of found words
    // loop through pages
    for (var i = 0; i < this.numPages; i++ ) {
       bFound = false; // set found flag to false
       numWords = this.getPageNumWords(i); // number of words on page
       // loop through the words on page
       for (var j = 0; j < numWords; j++) {
          // get word pair to test
          ckWords = this.getPageNthWord(i, j) + ' ' + this.getPageNthWord(i, j + 1); // test words
          // check to see if word pair is 'Employee' string is present
          if ( ckWord == "Employee") {
             bFound = true; // indicate found logical value
             console.println('Pages that includes an employee signature: ' + (i + 1) +' ');
             break; // no need to further test for this page
          } // end Employee Signature
       } // end word loop
       // test to see if words not found
       if(bFound == false) {
             console.println('Pages that do include an employee signature: ' + (i + 1) +' ');
        } // end not found on page  
    } // end page loop
    Thank you

Maybe you are looking for

  • To find my errror in this decode function

    SELECT OFF_NAME,off_name_form , SUBURB_FORM, BRAND1, BRAND2, DECODE(BRAND2, BRAND2 IS NOR NULL, BRAND2||' '||'-'||' '||OFF_NAME_FORM, BRAND1||' '||'-'||' '||OFF_NAME_FORM) from REL14_8_AU_POI_INTERM A, POI_RELEASE.REL14_8_AU_POI_BRAND B WHERE A.IDX=B

  • How to use padding scheme FIPS81 in java plz help?

    Plz refer the below code using this code I m trying to decrypt XLS file using pass phrase. I m using the same pass phrase which was used @ the time of encryption. But the problem I m facing is that the file was encrypted in DOT NET_ using padding sch

  • Quicktime has started to 'judder' when playing HD?

    MacBook Pro 1.16 Intel Core Duo (2G DDR2 memory) ; Quicktime 7.5.5 Quicktime has recently started to judder, stutter, when playing HDV 3/4's size or full screen. This is on a MacBook Pro Intel. It hasn't always done this. And.... I notice that when I

  • Display of Browser and Fullscreen

    Hi, I'm on a MacBook with an external monitor connected to it. I want to display the Browser in the MacBook and the fullscreen picture at the external monitor. The MacBook is the first display and contains the dock bar. How should I configure the set

  • ITunes Videos/Shows to DVD

    Does anyone know if you can burn your iTunes shows/videos to DVD?