Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6083491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:24:32+00:00 2026-05-23T11:24:32+00:00

i dunno but i might be missing something, i’ve tried a few thigns but

  • 0

i dunno but i might be missing something, i’ve tried a few thigns but they all end up with the same result and i’m about to start pulling my hair out

<script type="text/javascript">
function set_size() {
// Get users Screen Res
var screen_height = screen.height;
var attribute = "height";
var element = "pdfFile";

// Take say 200px off the res to accumulate the browser screen useage
var object_height = screen_height - 200;

// Write to the height attribute
document.getElementById[element].getAttribute[attribute].value = object_height;
document.getElementById['jsoutput'].innerhtml = object_height;
}
</script>

<div class="Contact_list">
<a name="contacts"><object id="pdfFile" data="files/contacts/pdf/contacts.pdf" type="application/pdf" width="100%" height="600" style="border: 1px solid;"></object></a>
<span id="jsoutput"></span>
</div>

<script type="text/javascript">
set_size();
</script>

[12:13:28.050] document.getElementById[element] is undefined @ http://localhost/**/index.php?page=contacts#contacts:57

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:24:33+00:00Added an answer on May 23, 2026 at 11:24 am

    Both of these should not be like this:

    // Write to the height attribute
    document.getElementById[element].getAttribute[attribute].value = object_height;
    document.getElementById['jsoutput'].innerhtml = object_height;
    

    but should be like this:

    // Write to the height attribute
    document.getElementById(element).style.height = object_height;
    document.getElementById('jsoutput').style.height = object_height;
    

    getElementById and getAttribute are functions whose parameters goes in parentheses, not in brackets.

    Height is set by setting style.height, not setting .value on an attribute.
    You generally do NOT set the height on an inline element which a <span> tag is. You can set the height on a block element or an inline-block element. So, your attempt to set the height on the jsoutput object will probably not do what you want.

    Also, the innerHTML attribute must be capitalized as innerHTML, not innerhtml, though you weren’t using that attribute correctly anyway so I replaced it with style.height.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I dunno guys, this is a really weird one, but I might just be
Alright, this might be simple but I dunno how to do it! I have
Ok, so this might be kinda stupid, I dunno know, but I was wondering
I dunno exactly but i think \s*\d* is something like string + int and
I dunno about USA and the UK, but in India, schools still teach GW-BASIC.
Hai am trying to access the aspx variable.But i can't to do this.I dunno
i dunno, but will your machine suffer great slowdown if you use a very
I want to use Crypto++ in Eclipse. I've installed it correctly but I dunno
Is there something like ISNULL() OR COALESCE() but not that checks for null value
I have tried some tips I was given on regards URL encoding but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.