Embedding javascript files

I need to embed a Javascript file in the body of all my Apex pages, in the form
<body>
<script type="text/javascript" src="myscriptfile.js"></script>
</body>This is easy to do with a bog standard HTML page but I'm not sure how to do it in APEX. So I have 2 questions -
1. What would be the best way to accomplish this? I was thinking along the lines of embedding this HTML in my application template (obviously without the BODY tags). Is this the best way to go?
2. Where on my server/PC do I save the myscriptfile.js file so it gets picked up by all my APEX pages?
Cheers
Antilles

This will depend on where you store your javascript file:
1. if you store it in the apex image directory (/i/) you can put it in the page template header (do it for all page templates):
&lt;script src="#IMAGE_PREFIX#your_javascript_files/javascript_file.js"  type="text/javascript">&lt;/script>2. if you upload the file into your workspace and do not associate it to an application you could put this into the page template header (do it for all page templates):
&lt;script src="#WORKSPACE_IMAGES#javascript_file.js"  type="text/javascript">&lt;/script>or if you associate it with an applciation
&lt;script src="#APP_IMAGES#javascript_file.js"  type="text/javascript">&lt;/script>Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
-------------------------------------------------------------------

Similar Messages

  • Firefox 4.0 support for printing embedded PDF files in iFrames via JavaScript

    I recently upgraded to Firefox 4.0 and can no longer print embedded PDF documents contained in an iFrame.
    My company's web application has several pages which load PDF files from a Servlet into an iFrame. The pages in question all have "Print" buttons which when clicked executes a JavaScript function to obtain reference to the iframe containing the PDF, place it into focus() (e.g., frames['pdfdoc'].focus();), and invoke print() (e.g., frames['pdfdoc'].print();). There are no errors, or exceptions caught when the JavaScript function is invoked, but the "Print" button is no longer operational.
    Does Firefox 4.0 no longer support iFrames? The issue goes away if I revert back to ver 3.6.16

    I have same issue for printing embedded PDF files in iFrames via JavaScript in Firefox 5.0.
    In previous versions it was working fine. But not in Firefox 4.0/5.0.
    Is there any solution for this problem?

  • Help with embedding Javascript for Lightbox Photo Gallery in Muse!

    Hi all:
    I am fairly new to Muse and I have been having trouble finding relevant information for embedding Javascript in order to get a lightbox to work in Muse. Would anyone be able to walk me through embedding the Javascript for the Lightbox Photogallery for Picasa in Muse?
    This is the code I want to use: Lightbox Photo Gallery and Slideshow for Picasa
    And this is the look I am trying to accomplish within my Muse site: Cycling Around The World / January 2006 / Picasa Template by www.paulvanroekel.nl
    Any help would be appreciate. Thanks much,
    Alexis

    Hi,
    I have tried inserting the script that you have pasted above as HTML on my test site and it worked.
    What happens is whenever you insert something as HTML, Muse by default creates a div tag and places the content within the div tag. What I have done differently is I have inserted the JS with in the <script> tag and it has inserted the Javascript in this manner,
    I beleive that since this a browser re-direct script that you are using, you would like to place this in the head section and not in the body tag, however, that is certainly not possible using Muse as it does not allow access to the code it generates as a muse file.
    You, can still export the pages as HTML and make the appropriate changes there before uploading to the server.
    Hope that helps.
    Regards,

  • Embedded wav files not playing in IE7 after installing QT 7.3

    I created a web page that uses javascript to play embedded wav files on an onclick event. I was having trouble with my Firefox browser not playing the wav files at all, so I thought I'd update from QT 7.1 to QT 7.3. This has caused my IE browser to stop playing the embedded files, and has not helped my Firefox browser, either. Uninstalling QT 7.3 does restore IE7's ability to play the embedded files. I'm using some simple popular Javascript for the function, and the page works for me in my home installation of Firefox, so I'm still mystified why the wav files won't play on my workplace Firefox (yes, I tried disabling all the other plugins, to no avail), and also, I need to fix IE7 now, as well. QuickTime Object is enabled in IE's add-ons list.
    I did search all over the knowledge base here and at Firefox's site for solutions.
    Suggestions?

    Internet Explorer requires the "object" tag code and your html only uses "embed".
    http://developer.apple.com/internet/ieembedprep.html for more info.

  • SQL injection embeded .js file to execute CF hack

    I am a programmer sent to investigate suspicious activity at
    a client's web application. I cannot attach a file in case of
    infection potential. The Coldfusion code is open to SQL injection
    attack which is how we believe the Apache web server became
    infected. Upon investigation we found javascript files which had
    been written with CFML code programatically scripted to fit within
    a .js javascript file and write and read data from the server.
    Has ANYONE seen this type of attack before? I cannot disclose
    the client or specific data as we are under a NDA (Non-Disclosure
    Agreement), however, I need help of other Coldfusion programmers to
    fully understand this attack. Has anyone seen CFML code programmed
    into a .js javascript file and run by calling the .js javascript
    file before?
    We have found japanese or chinese language within the code
    and within files on the server. The client states they have NOT
    installed any language packs or anything referencing other
    languages than English. There have been japanese characters found
    on the database server. There are hundreds of .js and .xml files on
    the server which reference japanese. Furthermore, we have found
    many XML files on the server,but the client does not use .xml so
    these .xml files would then be foreign and potentially
    programatically scripted by the server launching code to write
    these files under the un-knowing eyes of the client.
    So we need to understand the limits or potential threats:
    1. Can CFML scripting be embedded into a .js javascript file
    2. If database parameters are not locked, what are the
    possible attacks available to SQL injection
    Any help would be appreciated.
    Thank you in advance.
    Alex Dove

    1. Only if the server is set to parse a .js file as CFML
    2. A lot!
    http://www.forta.com/blog/index.cfm/2008/7/22/For-Goodness-Sake-Use-CFQUERYPARAM-Already
    http://www.forta.com/blog/index.cfm/2008/7/23/Hacker-Webzine-Recommends-Use-Of-CFQUERYPARA M
    Ken Ford
    Adobe Community Expert - Dreamweaver/ColdFusion
    Fordwebs, LLC
    http://www.fordwebs.com
    "ajdove" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I am a programmer sent to investigate suspicious
    activity at a client's web
    > application. I cannot attach a file in case of infection
    potential. The
    > Coldfusion code is open to SQL injection attack which is
    how we believe the
    > Apache web server became infected. Upon investigation we
    found javascript
    > files which had been written with CFML code
    programatically scripted to fit
    > within a .js javascript file and write and read data
    from the server.
    >
    > Has ANYONE seen this type of attack before? I cannot
    disclose the client or
    > specific data as we are under a NDA (Non-Disclosure
    Agreement), however, I need
    > help of other Coldfusion programmers to fully understand
    this attack. Has
    > anyone seen CFML code programmed into a .js javascript
    file and run by calling
    > the .js javascript file before?
    >
    > We have found japanese or chinese language within the
    code and within files on
    > the server. The client states they have NOT installed
    any language packs or
    > anything referencing other languages than English. There
    have been japanese
    > characters found on the database server. There are
    hundreds of .js and .xml
    > files on the server which reference japanese.
    Furthermore, we have found many
    > XML files on the server,but the client does not use .xml
    so these .xml files
    > would then be foreign and potentially programatically
    scripted by the server
    > launching code to write these files under the un-knowing
    eyes of the client.
    >
    > So we need to understand the limits or potential
    threats:
    > 1. Can CFML scripting be embedded into a .js javascript
    file
    > 2. If database parameters are not locked, what are the
    possible attacks
    > available to SQL injection
    >
    > Any help would be appreciated.
    > Thank you in advance.
    > Alex Dove
    >
    >

  • Embedding javascript with xslt generated html

    hi,
    I'm using xml/xslt with xdk to generate html with embedded javascript. The solution works except that I am having problem with proper inclusion of the javascript file. I uset this line:
    <xsl:template match="/">
    <head><title>Screener</title>
    <!-- Javascript declarations -->
    <script language="javascript1.2" src="./screener.js">
    </script>
    I have tested the xslt sheet via IE5 and msxml3 processor and it works fine including loading the javascript file.
    Now using XDK and servlet it doesn't seem to retrieve the javascript file so all javascript function do not work.
    I would appreciate any help.
    thanks,
    ted
    null

    hi brian,
    All those files are in same directory i changed the .xsl file to be i am changing at the right place.
    However, as backup i tried the following:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html"/>
    <script language="javascript1.2">
    <![CDATA[
    <!--
    var isNav4, isIE4;
    if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
    isNav4 = (navigator.appName == "Netscape")? true:false
    isIE4 = (navigator.appName.indexOf("Microsoft" != -1)) ? true:false
    if (isNav4) { document.write("<B>It's a Navigator!</B>");}
    else { document.write("It's an Explorer!");}
    //== shared global variables
    function _alert(e)
    alert(e);
    -->
    ]]>
    </script>
    and here is the html output:
    <html>
    <head>
    <title>Screener</title>
    <script language="javascript1.2">
    &#60;!--
    var isNav4, isIE4;
    if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
    isNav4 = (navigator.appName == "Netscape")? true:false
    isIE4 = (navigator.appName.indexOf("Microsoft" != -1)) ? true:false
    if (isNav4) { document.write("&#60;B>It's a Navigator!&#60;/B>");}
    else { document.write("It's an Explorer!");}
    //== shared global variables
    function _alert(e)
    alert(e);
    -->
    </script>
    </head>
    So everything is being output correctly except for <!--; is there a way around this problem? If I leave out <!-- --> it works but
    i was wondering if the present behavior is what's supposed to happen.
    thanks,
    ted
    null

  • Embedded Javascript and CSS removed from mail

    Hey folks,
    I wrote a small app to send a html email to myself.
    When I sent it inline all the embedded javascript and css were removed.
    When sent as a .html page attachment and opened from within the browser (Gmail, Mozilla 2.0)
    all the embedded script and css were gone. However when downloaded to the machine, it was all there.
    Looks like this is a browser issue, would anyone know how to get around it?
    It's so that I can have collapsable headers in my email message.
    Thanks,
    Mark.

    Hi Tony.
    Yes, it's possible. Read [Wiki WPC FAQ|https://wiki.sdn.sap.com/wiki/display/KMC/WebPageComposer-FrequentlyAskedQuestions+%28FAQ%29#WebPageComposer-FrequentlyAskedQuestions%28FAQ%29-WhataboutusingstandardHTMLpagesinWPC%3F].
    KM supports relative links in HTML documents so it may be necessary include any dependent files in the same folder as the HTML document.
    In case of a web page and its dependent files are stored in different folders you need editing the source html code:
    1. use Portal Drive and any text editor (I prefer Notepad++. It has the feature "Search and Replace in files") to open the html source file.
    2. search for links to dependent files and add the following pattern: /irj/go/km/docs//<path to an dependent file>/ before a filename, for example:
    You have a web page with css file. The page is stored in documents repository under the folder with ID old_pages. The css is resides in css folder.
    So the existing code
    <LINK REL=STYLESHEET TYPE="text/css" HREF="css/style.css">
    should be replaced with the
    <LINK REL=STYLESHEET TYPE="text/css" HREF="/irj/go/km/docs//documents/old_pages/css/style.css">
    Best regards,
    Aliaksandr

  • Page-embedded Javascript and uploaded images are not cached.

    Hello All,
    I was reading in Wiki APEX and I found this line mentioned as cons: "Page-embedded Javascript and uploaded images are not cached".
    The question that I have posted many questions here how to enable the cache for Images and Javascripts but didn't get it right, is the wiki info right about the cache for images and JS?
    thanks,
    Fadi.

    Look at the bottom of this page as well [http://carlback.blogspot.com/2007/12/apex-and-3rd-party-js-libraries.html]
    Patrick Wolf
    Carl,
    the only drawback with #WORKSPACE_IMAGES# and #APP_IMAGES# is that it doesn't get cached by the browser. So each page request will transmit the hole file again. A caching option for the "Static Files" in the Shared Components would be nice :-)
    About lazy loading with the #WORKSPACE_IMAGES#. I could think about a mod_rewrite rule which translates the additional file request of the JS library into a valid request for APEX.
    Carl Backstrom
    In 3.1 we emit a last modified header now for uploaded files so that should help with browser caching.
    I wonder if anything's changed since then.
    Kofi

  • Invoking external javascript file from xdp source

    Is it possible to invoke an external javascript file from within the xdp source? I know it is possible to embed the javascript in the form.
    If this is possible, would I be correct in assuming that this is also possible from pdf source?
    Basically I am looking to show / hide buttons based on the status associated with a form at a given time in the flow. My understanding of PDFs is that the source cannot be edited once it has been created? If this is the case I was hoping that there could be code embedded that would call on the external file which would return the status of the letter. Based on the response buttons / fragments etc could be shown / hidden as required.
    Feedback required asap please!
    Thanks in advance.

    You cannot call outside of the rendered form. So you have a couple of means to get information into the form. Merge dat aonto the form (in your case you can use a field as a flag and key off of that),or use Web Service call to check the status.
    Hope that helps
    Paul

  • How do i stop the "Opening Ads" download javascript file everytime i access a website which uses googledoubleclick ads??

    Every time a access a website which has embedded googledoubleclick ads in it, i get this pop up-like thing which tells me to download a javascript file called "ads", from http://googleads.g.doubleclick.net and it asks me to save it... i would love to send a screenshot, but this question text area doesn't allow me...
    therefore, i have uploaded the snapshot .jpeg file on my website so you can see it. This has been bothering me a lot, sometimes there are pages which have embedded 5 ads, and i get a pop up for each ad. Mind you, it's not the window popup that you get, it's a download popup...
    snapshot link:
    http://www.avosarafian.com/snapshot.jpg
    regards,
    Amjo

    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

  • Embedded swf file won't launch pop-up in safari

    The following page has an embedded swf file which when clicked is supposed to launch a 800x600 pop-up html file.
    http://www.artfair.com.au/index-2008.htm
    The action script I'm using in the movie is
    on (press, release) {
    getURL("javascript:openNewWindow('http://www.artfair.com.au/2008_interim/htm/in terim.htm','interim','height=600,width=800,toolbar=no,scrollbars=yes')");
    The html code is:
    <BODY bgcolor="#FFFFFF">
    <!-- URL's used in the movie-->
    <!-- text used in the movie-->
    <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve rsion=6,0,0,0"
    WIDTH="100%" HEIGHT="100%" id="2008" ALIGN="">
    <PARAM NAME=movie VALUE="2008.swf"> <PARAM NAME=loop VALUE=false> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=best> <PARAM NAME=salign VALUE=LB> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="2008.swf" loop=false menu=false quality=best salign=LB bgcolor=#FFFFFF WIDTH="100%" HEIGHT="100%" NAME="2008e" ALIGN=""
    TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
    </OBJECT>
    </BODY>

    Doesnt work on any browser
    XP:
    IE6
    IE7
    FIREFOX2
    or OS X 10.4.9
    safari or ff2
    post the code on Adobe.com's forums for the flash developers as theyll be able help you recode the link as ive noticed int eh XP browsers it tells me its a javascript error, ill take a nothe rpeak at the flash document/javascript and see if i can pick apart what might fix it but for the meantime id suggest submitting this to the flash forums as its a Flash/Javascript/Actionscript issue not a Safari issue
    =]
    ill let you know if i notice anything before you find a solution.
    also let me know if you do find the issue because ive been looking to put together a pop up window in flash but none seem to work properly.

  • "Error: the xajax Javascript file could not be included. Perhaps the URL is incorrect? URL: /includes/javascript/xajax_js/xajax.js". other posters with a xajax error on this board got the response to go look for developer resources. (i'm not a developer)

    I'm on a mac running 10.6.8, was using Firefox 6.02 when the problem started, i performed a clean install of 7.01, installed the latest Flashplayer, and reinstalled java (the 10.6.5 update file from apple's site).
    I seem able to load video at youtube.com, and was able to load web-based irc chatrooms at ircchat.tv. however, at jamplay.com a paid member site, all of the lessons are flash video, and there's a live video feed chat room that is also flash based, and I am not able to view this content. the video content pops up the error message "Error: the xajax Javascript file could not be included. Perhaps the URL is incorrect?
    URL: /includes/javascript/xajax_js/xajax.js" and the clicking on the "launch chatroom" button does exactly nothing.
    I have contacted the jamplay site team but their recommendations are the steps I have already taken, mentioned above, that did not resolve the issue.
    some links to content on their site visible without being a member:
    http://www.jamplay.com/
    this one has a flash interface that, if things were working, would have a video in the center and members and staff talking abouth that area of the site when you click on one of the title buttons. Now that I am having this problem, nothing is clickable and there's no indication that there should be a video in the center. The error message regarding xajax does not come up at all.
    http://www.jamplay.com/guitar-lessons/beginners/1/527-16-circle-of-fifths
    same thing. video content is missing, xajax error does not appear.
    http://www.jamplay.com/live
    when I load these all content except the video loads on the page. this page does not give me the error at all, just does not load the video
    I can't seem to recreate the actual error without being logged in as a member of the site.
    The apple support team gave me a one-time free suppport ticket to troubleshoot an ethernet issue I was having. Unfortunately, the databases I removed were not deemed either by apple or me to be noteworthy or necessary to retain (all of them were for software I not longer have or use). I don't know which plist file might have been the one I need now. I did reinstall the java and flash items. The only other item that I think it might be is a set of belkin router software that I uninstalled because i'm not using any belkin hardware anymore.
    If someone has any kind of idea I would be most appreciative.

    That's a comment in the file. It has no effect at all.

  • How do I get a handle on embedded sound files?

    From the Sound Class information, it says to use the SoundMixer Class to handle embedded Sound Files.  I have two sound files embedded, that I have setup in 2 separate layers, starting at frame one in the main timeline.  I needed to do this so I could see the wave files, and coordinate text with the waves.  I do not want to load these files into the .swf file at runtime using URLRequest.  How do I get a handle on those as they exist, to make each controllable by separate volume and mute controls for each sound?
    This will be a challenging question, because, "it can't be done" doesn't work for me.  I managed to create a way to use an external classfile to control the main timeline, the ROOT timeline, without having to create a sub movie to root.  I can use my component to call play(); as though it were in code in a frame.  But it isn't, it's in an external classfile.  I passed root to the classfile and told the classfile to think of it as a movieclip - that put the handle on it.  I tried similar way with root as a Sound, but that isn't detailed enough - I need to get a handle on the frame that contains the embedded sound file.  I embedded, attached it, using the properties view for the frame.
    I've attached, or whatever you want to call it, these sound files to a frame, and this frame is or should be attached to the layer I've created.  So, under the assumption that the ROOT has everything attached to it in some manner (it is after all the foundation for the COM), the stage of the root contains the visual components, so ROOT has to have the layer objects attached to it, which should have the frame objects attached to the layers.  I have two layers that each have a .wav file attached to frame one.  Somehow Flash keeps track of that - I want to know how Flash does it so I can read what flash reads.
    If this seems redundant, it probably is.  I want to paint the best picture I know how so I can get detailed feedback.  Please, if you have questions ask them so we can clarify, and get this resolved!  Thanks for reading!

    lol.
    ok, it can be done.  keep working on it.

  • Javascript file - open BI Publisher report

    Good afternoon.
    I'm not sure if this is even possible but hopefully one of you experts out there will be able to advise;
    I had some javascript in my page which contained a simple function to open a BI Publisher report, it was:
    function run_40BFG()
    popupURL('&BI_URL.Guest/MyFolder/MM_40BFG/MM_40BFG.xdo?_xpf=&_xpt=1&P_CASE_ID=&P303_CASE_ID.&xt=MM_40BFG_xf=rtf');
    ...this worked fine. To improve maintainability (I don't want to amend the Page Header each time I add a report), I wanted to extract this function and place it in a javascript file which I have done with 'some' success.
    Page Template amended - OK
    Page Header global variables added - OK (tested with simple 'alert' function and all was fine)
    Now the function in the javascript file looks like:
    function run_40BFG()
    popupURL('gBIurl.Guest/MyFolder/MM_40BFG/MM_40BFG.xdo?_xpf=&_xpt=1&P_CASE_ID=gCaseID.&xt=MM_40BFG_xf=rtf');
    ...but each time I receive a 500 Internal Server Error.
    Is it at all possible to run a BIP report from an external javascript file? If not, is there another way?
    If it is possible, what am I doing wrong?
    Thanks in advance!
    Sue

    ...just wanted to bump this up the thread list in the hope that someone will be able to help!
    Thanks

  • When I try to open an embedded PDF file I get an error "The program used to create this object is AcroExch.exe.

    When I try to open an embedded PDF file (Word doc) I get an error "The program used to create this object is AcroExch.exe. That program is either not installed on your computer, or is corrupt..."  I've tried  about everything from unchecking
    protected mode at startup to removing & reinstalling Adobe.  Nothing seems to fix this issue.  Any other ideas?
    This is happening on Adobe reader 9, 10 & 11 with MS Word 2010 & 2013.  I've uninstalled, cleaned & reinstalled Reader 9, 10 & 11, as well as Acrobat 10 Pro & 11 Standard.  Removed "Protected mode at startup, and changed
    the default program for viewing from reader to Acrobat.  This will not go away.  It is affecting production at our company.

    " Help > Troubleshooting Information > Profile Directory: Open Containing Folder" . i can't find open containing folder in profile directory. it does give me the option to open the places.sqlite file using graphic converter. when i try that, graphic converter gives me a window saying that it can't be opened because it is corrupted or is not a file type supported by graphic converter.
    i appreciate your help with a workaround to get the old bookmarks. that works. however, the problem has morphed from that concern to why adobe reader [the default app.] won't open firefox .sqlite files. is the problem in adobe reader or firefox? also, how can i tell if the places.sqlite file is corrupt?
    i'm getting in over my head here and do appreciate your help.

Maybe you are looking for

  • Partner Self-registration in Oracle B2B 10g

    Hi B2B team, Wanted to confirm from you if there is any provision for Partner self-registration in Oracle B2B 10g. We are on the latest patch. I am not aware of this functionality but wanted to get this confirmed from the product team. Also, we will

  • Line Item Dimention Vs Hig Cardinality

    HI ALL            I have a problem with a cube and the below are the challenges...                    1) can we use High cardinality / line item dimension if we already used one of these(High cardinality / line item dimension)?                    2)

  • Flatten to XML does not save Item Names of ListBox to XML file.

    On my Front Panel, I have a ListBox Indicator that has Strings from which the User can select. Also the User can edit items in the ListBox to add new elements. After the user selects one and pushes my Save button, I use the Flatten to XML function to

  • Is there a way to convert the Itnues media to PSP format?

    As the Title states, I want to know if theres a way to put Itunes movies and videos into Mp4 format for PSP videos. I know this will probably be looked down upon in the Apple community. But I just don't have an Ipod.

  • Problem with code and design view

    When I try to have both the code and design view side by side in Dreamweaver CS4 on a PC -- I get the html code in both sections. How  do I see the layout while looking at the code? Thanks for help. Library Friend