Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: output to a specific location in html code

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default output to a specific location in html code

    Hi. I have this issue:
    I'm using a Java script (taken from a website) that detect screen resolution and apply a CSS for each size.
    The code lucks like this:
    if ((screen.width==1024) && (screen.height==768)) {
    alert('Screen size: 1024x768');
    $("link[rel=stylesheet]:not(:first)").attr({href : "CSS/grafica1024.css"});
    }
    In stead of alert message i what to publish in html code (in page position: down, i can use CSS for this(for positioning)) a text that say " Screen size : ...." or "Screen resolution: ..." (don't matter, is a fixed text).
    I search on google and i found function document.write() but if i used my hole html page is rewrited. I dont want this, i want just to output a line in html with <p> in that code, not new page and if is posible to use CSS ( for positioning the text in page).
    Thank u very much and sorry for my english


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: output to a specific location in html code

    Sorry, wrong forum.

    java is not javascript.

Similar Threads

  1. [SOLVED] Code is correct, but incorrect output?
    By moodycrab3 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: February 6th, 2011, 02:32 PM
  2. How to write to specific part of an html file using java
    By nasi in forum File I/O & Other I/O Streams
    Replies: 12
    Last Post: May 27th, 2010, 11:22 PM
  3. why does this code read an html file uncontinuously
    By nasi in forum What's Wrong With My Code?
    Replies: 4
    Last Post: March 25th, 2010, 09:09 PM
  4. Implementing HTML tags in Java Source Code
    By bookface in forum Java Theory & Questions
    Replies: 4
    Last Post: March 19th, 2010, 09:29 PM
  5. Changing output from console to .html
    By RSYR in forum File I/O & Other I/O Streams
    Replies: 6
    Last Post: December 10th, 2009, 07:55 PM