JavaScript help Including JavaScript in a .js File Referenced by the Page

I need help with JavaScript. I have been doing the Advanced Tutorial, and still don't feel that understand how to make it work.
The example in "Oracle Database Application Express User's Guide" shows this line:
<script src="http://myserver.myport/my_images/custom.js" type="text/javascript"></script>
I understand that "my_images" is hypothetical, but where is the real equivalent to this?
Is there a working example/tutorial of Including JavaScript?
<li />Also how does one create AJAX functionality?
If I want to do something like this http://www.w3schools.com/ajax/ajax_server.asp
in APEX, where do I place the "time.asp" script?
<li />Can we assume that the HTML and ASP file are in the same directory?
Please any assistance with these topics are greatly appreciated.

Hello,
>> what is the directory structure you would use for /my_images/custom.js? Where does one load these .js files? where is it in the local machine?
C:\oracle\product\10.2.0\db\Apache ?
The documentation only gives you a possible example (and I might agree that it’s not the best one). You should put your external JS files (on the server OS file system) wherever it will be most accessible and maintainable for you. The best place, IMHO, is under the /images/javascript/ directory. The reason is very simple. You can use the alias /i/, which defined in your DAD file, to gain a very simple path to the file. In this case, the loading statement will look similar to the following:
<script src="/i/javascript/custom.js" type="text/javascript"></script>
>> Do you mean "Oracle Database PL/SQL Packages/Types and htp packages?"
I’m assuming you are talking about the on-demand process. This is a regular PL/SQL anonymous block, which will be fired only upon specific request - http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10499/bldr.htm#BABEAIIE . This is the mechanism for handling the server side of AJAX.
>>Anythig else available for us to levarage?
Denes examples site can also be a valuable resource - http://htmldb.oracle.com/pls/otn/f?p=31517:1 .
Regards,
Arie.

Similar Messages

  • Including JavaScript in a .js File Referenced by the Page Template

    http://download-uk.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28839/javascript.htm#BCEHEFGF
    Hi trying to implament Patrick's Library
    In the above it gives you the following to put into the template header
    <script src="http://myserver.myport/my_images/custom.js" type="text/javascript"></script>
    I take it
    my server is server1.blahblah.co.uk
    port is 1577 or somthing
    my_images is the default image folder
    so you would get somthing like ...
    <script src"http://server1.blahblah.co.uk.1577/images/jquery_Compressed.js"type="text/javascript"></script>
    <script src"http://server1.blahblah.co.uk.1577/images/ApexLib_Compressed.js"type="text/javascript"></script>
    <script src"http://server1.blahblah.co.uk.1577/images/ApexLib.css"type="text/javascript"></script>
    am I on the right lines?

    Hello,
    If you are using the base APEX images directory for the ApexLib JavaScript files, As Patrick recommends in his installation “How To” document, you can use the alias /i/ for your path. For example:
    <script src="/i/apexlib/jquery_Compressed.js" type="text/javascript"></script> It’s simpler and portable this way.
    CSS files should be loaded using the <link> tag (http://www.w3schools.com/tags/tag_link.asp). In your case, you should use something like this:
    <link rel="stylesheet" href="/i/apexlib/ApexLib.css" type="text/css" /> Don’t skip the ‘=’ sign on your src attribute.
    Regards,
    Arie.

  • Can I Save a Single .AI Document As Multiple Files, Seperated by the Page Tiling?

    There must be a way to save or output a single Adobe Illustrator file  into multiple files based on the "pages" I have created in the  document?
    For example, if I have tiled 10 tabloid-sized  pages onto a single Illustrator CS3 .AI file, is it possible to save  the file in a manner that will allow all of those tiled pages to be  saved as a seperated or individual files?
    I guess it  would be a similar concept to how in newer versions (like CS4) you can  export multiple jpegs of an illustrator file that contains several  artboards and it automatically assigns a number suffix to the filename  since multiple files were outputted from the single ai file.
    Any  help is MUCH appreciated. Thanks!

    Please post your question in the Illustrator forum. This forum is for suite specific issues only.
    Bob

  • Where are the "exercise files" referenced in the video tutorial for After Effects?

    Where are the "exercise files" referenced in the video tutorial for After Effects?  A search yielded no results.

    Creating your first project | Learn After Effects CC | Adobe TV

  • Quicktime movie - publishes a ghost file, placing on the page

    I have two questions.
    First - the ghost file
    I dragged a Quicktime movie file to a page and then published to a folder. I realised that I had attached a 27Mb file instead of a smaller file (750k) that I had meant to. I deleted the large file (select/delete) and dragged the new file on to the page and published to a new folder. However the large file keeps publishing even though I thought I had deleted it. I always end up with the large file and small file in the published folder. How can I stop this happening?
    Secondly - placing on a page
    The QT movie has an area above the control bar for a graphic which I didn't fill. How can I accurately place the QT file on the page so I can line it up with text - the graphic box seems to stop text flowing around it or placing it where I want it.
    Thanks

    I suspect your ISP is serving you an older "cached" file instead of the new "fresh" one. More common overseas than here in the U.S. and some ISP's are worse than others.
    Try "refreshing" the page (Command-R in your browser) to see if it now finds the new page.
    If that fails (and it may because these ISP's are so aggressive about caching) try adding a question mark (?) to the end of the address in your browser:
    apple.com becomes apple.com?

  • Can Web Performance Test work on AJAX or Javascript Project which will show only one URL for all the pages?

    Hi there,
    I'm working on testing a AJAX and JavaScript Project which has several pages but all in the same URL. I need to test some attribute on the page or parameter past by AJAX or Javascript. Can Web Performance Test work to get what I want?
    Thanks,
    

    Hello,
    Thank you for your post.
    Web performance test is used to test if a server responses correctly and the response is consistent with what we expected. And we test the response speed, the stability and scalability.
    The Web Performance Test Recorder records both AJAX requests and requests that were submitted from JavaScript, but
     web test does not execute JavaScript. I am afraid that you can’t use web test to test parameter past by AJAX or JavaScript.
    Please see:
    Web Performance Test Engine Overview
    About JavaScript and ActiveX Controls in Web Performance Tests
    From the first link, “Client-side scripting that sets parameter values or results in additional HTTP requests, such as AJAX, does affect the load on the server and might require you to manually modify the Web Performance Test to simulate the scripting.”
    If you want to execute the function typically performed by script in web test, you need to accomplish it in coded web performance test or a web performance test plugin. Please see:
     How to: Create a Coded Web Performance Test
    How to: Create a Web Performance Test Plug-In
    I am not sure what the ‘some attribute on the page’ is. If you mean that you want to test those controls on the page, you can do coded UI test, which can test that the user interface for an application functions correctly. The coded UI test performs actions
    on the user interface controls for an application and verifies that the correct controls are displayed with the correct values. You can refer to this article for detailed information about code UI test:
    Verifying Code by Using Coded User Interface Tests
    Best regards,
    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • (Urgent help needed) how to read txt file and store the data into 2D-array?

    Hi, I have a GUI which allow to choose file from the file chooser, and when "Read file" button is pressed, I want to show the array data into the textarea.
    The sample data is like this followed:
    -0.0007     -0.0061     0.0006
    -0.0002     0.0203     0.0066
    0     0.2317     0.008
    0.0017     0.5957     0.0008
    0.0024     1.071     0.0029
    0.0439     1.4873     -0.0003
    I want my program to scan through and store these data into 2D array.
    However for some reason, my source code issues errors, and I don't know what's wrong with it, seems to have a problem in StringTokenizer though. Can anybody help me?
    Thanks in advance.
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.StringTokenizer;
    public class FileReduction1 extends JFrame implements ActionListener{
    // GUI features
    private BufferedReader fileInput;
    private JTextArea textArea;
    private JButton openButton, readButton,processButton,saveButton;
    private JTextField textfield;
    private JPanel pnlfile;
    private JPanel buttonpnl;
    private JPanel buttonbar;
    // Other fields
    private File fileName;
    private String[][] data;
    private int numLines;
    public FileReduction1(String s) {
    super(s);
    // Content pane
         Container cp = getContentPane();
         cp.setLayout(new BorderLayout());     
    // Open button Panel
    pnlfile=new JPanel(new BorderLayout());
         textfield=new JTextField();
         openButton = new JButton("Open File");
    openButton.addActionListener(this);
    pnlfile.add(openButton,BorderLayout.WEST);
         pnlfile.add(textfield,BorderLayout.CENTER);
         readButton = new JButton("Read File");
    readButton.addActionListener(this);
         readButton.setEnabled(false);
    pnlfile.add(readButton,BorderLayout.EAST);
         cp.add(pnlfile, BorderLayout.NORTH);
         // Text area     
         textArea = new JTextArea(10, 100);
    cp.add(new JScrollPane(textArea),BorderLayout.CENTER);
    processButton = new JButton("Process");
    //processButton.addActionListener(this);
    saveButton=new JButton("Save into");
    //saveButton.addActionListener(this);
    buttonbar=new JPanel(new FlowLayout(FlowLayout.RIGHT));
    buttonpnl=new JPanel(new GridLayout(1,0));
    buttonpnl.add(processButton);
    buttonpnl.add(saveButton);
    buttonbar.add(buttonpnl);
    cp.add(buttonbar,BorderLayout.SOUTH);
    /* ACTION PERFORMED */
    public void actionPerformed(ActionEvent event) {
    if (event.getActionCommand().equals("Open File")) getFileName();
         if (event.getActionCommand().equals("Read File")) readFile();
    /* OPEN THE FILE */
    private void getFileName() {
    // Display file dialog so user can select file to open
         JFileChooser fileChooser = new JFileChooser();
         fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
         int result = fileChooser.showOpenDialog(this);
         // If cancel button selected return
         if (result == JFileChooser.CANCEL_OPTION) return;
    if (result == JFileChooser.APPROVE_OPTION)
         fileName = fileChooser.getSelectedFile();
    textfield.setText(fileName.getName());
         if (checkFileName()) {
         openButton.setEnabled(false);
         readButton.setEnabled(true);
         // Obtain selected file
    /* READ FILE */
    private void readFile() {
    // Disable read button
    readButton.setEnabled(false);
    // Dimension data structure
         getNumberOfLines();
         data = new String[numLines][];
         // Read file
         readTheFile();
         // Output to text area     
         textArea.setText(data[0][0] + "\n");
         for(int index=0;index < data.length;index++)
    for(int j=1;j<data[index].length;j++)
    textArea.append(data[index][j] + "\n");
         // Rnable open button
         openButton.setEnabled(true);
    /* GET NUMBER OF LINES */
    /* Get number of lines in file and prepare data structure. */
    private void getNumberOfLines() {
    int counter = 0;
         // Open the file
         openFile();
         // Loop through file incrementing counter
         try {
         String line = fileInput.readLine();
         while (line != null) {
         counter++;
              System.out.println("(" + counter + ") " + line);
    line = fileInput.readLine();
         numLines = counter;
    closeFile();
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error reading File",
                   "Error 5: ",JOptionPane.ERROR_MESSAGE);
         closeFile();
         System.exit(1);
    /* READ FILE */
    private void readTheFile() {
    // Open the file
    int row=0;
    int col=0;
         openFile();
    System.out.println("Read the file");     
         // Loop through file incrementing counter
         try {
    String line = fileInput.readLine();
         while (line != null)
    StringTokenizer st=new StringTokenizer(line);
    while(st.hasMoreTokens())
    data[row][col]=st.nextToken();
    System.out.println(data[row][col]);
    col++;
    row++;
    closeFile();
    catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error reading File",
                   "Error 5: ",JOptionPane.ERROR_MESSAGE);
         closeFile();
         System.exit(1);
    /* CHECK FILE NAME */
    /* Return flase if selected file is a directory, access is denied or is
    not a file name. */
    private boolean checkFileName() {
         if (fileName.exists()) {
         if (fileName.canRead()) {
              if (fileName.isFile()) return(true);
              else JOptionPane.showMessageDialog(null,
                        "ERROR 3: File is a directory");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 2: Access denied");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 1: No such file!");
         // Return
         return(false);
    /* FILE HANDLING UTILITIES */
    /* OPEN FILE */
    private void openFile() {
         try {
         // Open file
         FileReader file = new FileReader(fileName);
         fileInput = new BufferedReader(file);
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
    System.out.println("File opened");
    /* CLOSE FILE */
    private void closeFile() {
    if (fileInput != null) {
         try {
              fileInput.close();
         catch (IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
    System.out.println("File closed");
    /* MAIN METHOD */
    /* MAIN METHOD */
    public static void main(String[] args) throws IOException {
         // Create instance of class FileChooser
         FileReduction1 newFile = new FileReduction1("File Reduction Program");
         // Make window vissible
         newFile.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         newFile.setSize(500,400);
    newFile.setVisible(true);
    Java.lang.NullpointException
    at FileReductoin1.readTheFile <FileReduction1.java :172>
    at FileReductoin1.readFile <FileReduction1.java :110>
    at FileReductoin1.actionPerformed <FileReduction1.java :71>
    .

    1) Next time use the CODE tags. this is way too much unreadable crap.
    2) The problem is your String[][] data.... the only place I see you do anything approching initializing it is
    data = new String[numLines][];I think you want to do this..
    data = new String[numLines][3];anyway that's why it's blowing up on the line
    data[row][col]=st.nextToken();

  • // Code Help need .. in Reading CSV file and display the Output.

    Hi All,
    I am a new Bee in code and started learning code, I have stared with Console application and need your advice and suggestion.
    I want to write a code which read the input from the CSV file and display the output in console application combination of first name and lastname append with the name of the collage in village
    The example of CSV file is 
    Firstname,LastName
    Happy,Coding
    Learn,C#
    I want to display the output as
    HappyCodingXYZCollage
    LearnC#XYXCollage
    The below is the code I have tried so far.
     // .Reading a CSV
                var reader = new StreamReader(File.OpenRead(@"D:\Users\RajaVill\Desktop\C#\input.csv"));
                List<string> listA = new List<string>();
                            while (!reader.EndOfStream)
                    var line = reader.ReadLine();
                    string[] values = line.Split(',');
                    listA.Add(values[0]);
                    listA.Add(values[1]);
                    listA.Add(values[2]);          
                    // listB.Add(values[1]);
                foreach (string str in listA)
                    //StreamWriter writer = new StreamWriter(File.OpenWrite(@"D:\\suman.txt"));
                    Console.WriteLine("the value is {0}", str);
                    Console.ReadLine();
    Kindly advice and let me know, How to read the column header of the CSV file. so I can apply my logic the display combination of firstname,lastname and name of the collage
    Best Regards,
    Raja Village Sync
    Beginer Coder

    Very simple example:
    var column1 = new List<string>();
    var column2 = new List<string>();
    using (var rd = new StreamReader("filename.csv"))
    while (!rd.EndOfStream)
    var splits = rd.ReadLine().Split(';');
    column1.Add(splits[0]);
    column2.Add(splits[1]);
    // print column1
    Console.WriteLine("Column 1:");
    foreach (var element in column1)
    Console.WriteLine(element);
    // print column2
    Console.WriteLine("Column 2:");
    foreach (var element in column2)
    Console.WriteLine(element);
    Mark as answer or vote as helpful if you find it useful | Ammar Zaied [MCP]

  • Build an application installer and include files referenced in the code

    I want to make an application installer of my project, and I need to include a picture that I'm using in the code.
    This picture is used both in the vision assistant and in a low level color pattern match.
    What I need is some way to reference this picture in my code, so that when I create the installer and the project is installed on another computer, this file will always get referenced.
    Can someone please tell me how to do this?
    Thanks in advance!

    Your installer should be putting everything in the data folder you need.  So it should be fine.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Help needed in send and reciving file realtime over the web!

    Here is a scenario what I want to do and need some ideas about proceeding.
    I have a directory where the files are being added every 5 to 10 seconds. These files are to be transferred one at a time to some other location using some kind of secure protocol. The party receiving files will process each file and send the response back instantaneously. The send and response for each file is between 2 to 4 seconds. The response file is saved in a separate directory. If a successful response then sends another file and so on.
    The program iterates through the directory and if any files will send if no files wait for 10 seconds and check if any files to send and will run as long as someone manually shuts down. What's the better way to achieve this functionality.
    Any ideas the best approach and where to start. Thanks

    When you say "the send and response for each file is between 2 to 4 seconds," are you saying that's your requirement?
    What happens to the original files after they are sent? Are they deleted? If not, you need to be able to detect which files are new.
    You could write a standalone client and a standalone server, and do everything at the socket level.
    You could use a webserver to receive and process the requests.
    You could use SOAP or CORBA or JMS. It depends on more details of your requirements, your experience, time constraints to complete the project, environment...
    Basically you've walked into a car dealership and said, "I need a car. It should have an alarm and be able to go 80 mph. Which one is best for me?"

  • Why this site used php files in all the pages?

    Hola
    I download my friend's site and ALL the pages are in a folder with the file name index.php ... WHY?
    Example;
    Name of folder; gallery
    Inside this folder, a file with the name index.php
    Name of folder; contact
    Inside this folder, a file with the name index.php
    It has an "includes" folder with files for ;
    header.php, footer.php, content.php and functions.php
    and so on.
    Now, this site has ONLY 7 pages, it's not like it's a monster site, so
    what is the purpose of using php in every single page?
    I have to tell you that my friend has a program call CKeditor and CKfinder to
    edited her website.
    Not sure if this is the reason why this site has been coded all of it with php files.
    I'm waiting impatiently for your responce

    >Now, this site has ONLY 7 pages, it's not like it's a monster site, so
    >what is the purpose of using php in every single page?
    The reason for using php extension or not has absolutely nothing to do with the size of the site. If the site uses dynamic pages, then the page need a dynamic page extension. Even sites without dynamic pages often use .php in anticipation of using them so the file names won't need to be changed down the road.
    Now, if your question is more about why they created separate directories for each page, it's probably so the url's can be accessed without including the file extension, Ex
    example.com/contact
    instead of
    example.com/contact.php

  • I can no longer print anything except text edit files in firefox. I used to be able to do this. now, when I try to print, when I look at the pdf file version of the page, it is always blank and that is what prints. a blank page

    thats all i can say. used to print in firefox on my imac. haven't been able to do so in months. I can print perfectly in safari so it isn't my printer. I have checked every setting in every system and nothing changes the outcome

    I have firefox v 3.6.12, and i use adobe acrobat x ver.9, when print to pdf from firefox browser, always my windows 7 hang, at top windows (not responding)..and hang, task manager can not help...because hang too....the solusion is restart....please give me solution...trims

  • How can I name files separate from the page titles on the menu options?

    Ok, this is so much of a pain. I use a unix based web-server so the content is very case sensitive, and having spaces in the file names is just unmanageable. So.. how can I have pretty menu titles but have real world filenames?
    Presently I have to generate the pages, drop to vi and edit every frickin file to change the spaces to '_' characters and stuff. Depending on how many pages I have takes quite a long time.
    Anyone figured out a way to get around the stupid apple file naming convention ??
    /bk

    Thanks, I was afraid that was the case. So to have normal filenames that work cross platform I've got to manually tweak the pages once they are done. I suppose I was just hoping there was some 'expert' edit mode where I could have names for the files, vs names for the pretty menu items. Oh well, its not that bad I suppose it takes me say a day to manually code up a multi page site by hand, so if I can blow out a muliti page iWeb site in under an hour and then take another hour to tweak the code its still a win.
    Thanks again!!

  • This is actually a FF 4 RC question...but I can no longer open PDF files...the page just goes blank. No option in applications to set a PDF viewer as default. Help!

    How do you open PDF files in FF4 RC? The application section in options doesn't have PDF as an option to associate with a program. Whenever I click on a PDF file, I just get a blank tab.

    Hi there,
    You're running an old version of Safari. Before troubleshooting, try updating it to the latest version: 6.0. You can do this by clicking the Apple logo in the top left, then clicking Software update.
    You can also update to the latest version of OS X, 10.8 Mountain Lion, from the Mac App Store for $19.99, which will automatically install Safari 6 as well, but this isn't essential, only reccomended.
    Thanks, let me know if the update helps,
    Nathan

  • IMovie 09 has trouble importing large video files from my JVC HD-40. I am trying to edit files such as these in 09. What should I do? Would buying iMovie 2011 help? I am shooting AVCHD files instead of the other mpeg2 file format.

    Hi,
         I am new into the Apple Community. I have a camcorder known as the JVC GZ-HD40 US and I currently am trying to use iMovie 2009 to edit my movies. With my camcorder, I have the choice to use two different video formats: AVCHD or Mpeg2. All my videos are shot in the AVCHD (HD) file format. This camcorder also has a 120 G Hard Drive built into it. When I plug in the camcorder through USB to my MacPro, the Hard Drive of the camcorder shows up as a icon on the desktop. Many of my video clips are at least thirty minutes in length, inside the camcorder. When I try to import in iMovie my video files, it only imports around ten minutes of the video and skips to the end of the clip. I would greatly prefer to use my MacPro desktop to edit movies instead of my Windows 7 computer which seems to work fine. Is there a solution to this problem? Would the new iMovie 2011 application solve this problem? I also have the Final Cut Express to work with, and also, can't get it to work. What should I try doing?

    Hi all,
    I have the exact same problem. I've just been to Thailand with my girlfriend, and we recorded a lot of stuff with my brand new Sony HD camcorder. And whenever the we ran out of camcorder memory we just emptied everything onto my HP laptop using the supplied Sony software, which produced m2ts files. When we got home, I realized that my Mac Pro/iMovie09 was not able to import this format. What a huge disappointment! Especially considering the fact that I just bought my mac back in March (my first mac ever) only for video editing and music composing (no problems with music composing, however!).
    Well, I needed a solution, so last week I just bought the Voltaic HD converting software (35$), and it works great. No problems. Only thing is that my Mac Pro (quad intel core) had to work 24 hours a day for four straight days/nights in order to finish the converting job - resulting in 434 GB worth of mov-files. This is no problem as such, and the quality is great. BUT it seems rather stupid that this converting has to take place. If I use Sony Vegas on my PC, it works out of the box with my original m2ts-files. And I would really appreciate if Apple would implement a simple import function of m2ts-files in their software - one that would (if necessary) automatically convert the files to mov. Or even better: would work natively with the m2ts-files.
    Best,

Maybe you are looking for

  • Portal Runtime Error on sdn

    Hi, On sdn , in the Contribution Points Table , there is a Tab named  Additional Points. I got a link there with text Invitation to SAP Network Profiles When i click on that A Page opens with message Portal Runtime Error. An exception occured while p

  • MacBook Pro hard drive not seen.

    My MacBook Pro will not let me partition my new hard drive. It let's me select it in disk utility but when I try to partition or erase I get an error and when I tried to back it up from time machine the hard drive doesn't even show up as an option to

  • Problem with song transferring

    I am having a serious problem with my iPod. When I try to transfer songs onto it, after about 20 songs, the transfer process will begin to slow down dramatically by pausing on several random songs. Eventually, if the amount of music i'm trying to tra

  • DPM 2012 R2 Consistency Check (Replica Inconsistent) Error for Failover Cluster

    I have a SCDPM 2012 R2 instance running against a Windows Server 2012 R2 Failover Cluster on the network. However, any new/migrated Roles/Virtual machines that I add under an existing protection group always gives me an error saying that the replica

  • WRT54GS WEP Security Issues

    I have used a WRT54GS for a few years with MAC filtering but no other security.  A few months ago, I decided to add WEP security.  While using WEP security, my wireless connection would go from an excellent signal to dropping randomly.  Additionally,