Results 1 to 4 of 4

Thread: Problem Passing Data Dynamically in Java

  1. #1
    Join Date
    Jan 2009
    Posts
    67

    Problem Passing Data Dynamically in Java

    I am having a big trouble in java orinted platform. I am totally confused as how to pass data from javascript to server.

    I really don't have any idea regarding java script and java programming. Please provide some assistance regarding this problem

    Please help

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: Problem Passing Data Dynamically in Java

    The usefulness of being able to dynamically load a style sheet is fairly limited, but there is one very good reason to keep this tool handy: it lets you load a specific stylesheet for a specific browser. Instead of having one massive style sheet for every browser which visits your page, you can break out the stylesheets into browser specific Firefox, IE, Safari, Opera, etc styles which accommodate the eccentricities of each browser and let you serve smaller css files to your visitors to boot.

  3. #3
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Problem Passing Data Dynamically in Java

    PHP Code:
    var headID document.getElementsByTagName("head")[0];         
    var 
    cssNode document.createElement('link');
    cssNode.type 'text/css';
    cssNode.rel 'stylesheet';
    cssNode.href 'FireFox.css';
    cssNode.media 'screen';
    headID.appendChild(cssNode); 

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    Re: Problem Passing Data Dynamically in Java

    PHP Code:
    var headID document.getElementsByTagName("head")[0];         
    var 
    newScript document.createElement('script');
    newScript.type 'text/javascript';
    newScript.src 'http://www.somedomain.com/somescript.js';
    headID.appendChild(newScript); 
    It's really that simple. headID gets the <head> element of the page. Next we create a new 'script' element, assign it a text/javascript type, and then the url of the script (which can be anywhere on the net since it's basically a javascript include). Finally we append the new element to our head section where it is automatically loaded.

    If you're loading an external javascript and you need to know when the script has loaded you can simply use .onload=yourfunction; to set up the onload handler. Here's an example.

    PHP Code:
    var headID document.getElementsByTagName("head")[0];         
    var 
    newScript document.createElement('script');
    newScript.type 'text/javascript';
    newScript.onload=scriptLoaded;
    newScript.src 'http://api.flickr.com/services/feeds/photos_public.gne?tags=sunset&format=json';
    headID.appendChild(newScript); 

Similar Threads

  1. Passing by reference in Java
    By Amy Adams in forum Software Development
    Replies: 5
    Last Post: 06-04-2010, 11:17 AM
  2. Passing optional parameters in java
    By Miles Runner in forum Software Development
    Replies: 5
    Last Post: 05-03-2010, 10:20 AM
  3. Java properties / variables dynamically
    By Miles Runner in forum Software Development
    Replies: 5
    Last Post: 04-03-2010, 11:31 AM
  4. Message Passing in Java
    By rashmi_ay in forum Software Development
    Replies: 5
    Last Post: 25-02-2010, 10:33 PM
  5. Java & Oracle: Passing Date
    By garfield1 in forum Software Development
    Replies: 5
    Last Post: 04-01-2010, 12:30 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,038,889.93723 seconds with 17 queries