body 1 « Development « Javascript HTML CSS Q&A

Home
Javascript HTML CSS Q&A
1.animation
2.audio
3.background
4.browser
5.button
6.canvas
7.checkbox
8.Cookie
9.Development
10.DIV
11.dom
12.dropdown
13.editor
14.element
15.Event
16.Firefox
17.flash
18.font
19.Form
20.frame
21.hide
22.hyperlink
23.IE
24.iframe
25.image
26.innerHTML
27.json
28.layout
29.Library
30.localStorage
31.Menu
32.mobile
33.onclick
34.popup
35.Render
36.scroll
37.scrollbar
38.svg
39.tab
40.table
41.tag
42.text
43.TextArea
44.TextBox
45.validation
46.video
47.window
48.xml
Javascript HTML CSS Q&A » Development » body 1 

1. Permission denied to get property HTMLDocument.body    stackoverflow.com

I am doing a hidden http post in one page of my application which will login to another application via iframe. In that iframe i am able to access certain functions of ...

2. document.body.offsetWidth variations for different browsers    stackoverflow.com

document.body.offsetWidth returns the innerwidth value from left hand side to the left side of the vertical scrollbar in firefox. In IE it doesn't, instead it returns from left hand side to the ...

3. Body onload handler in a content page     stackoverflow.com

How do I call a Javascript function on the body load of a content page? As I can not use the body load of my master page's body onload in this. ...

4. Javascript: Have body onload function wait until scripts have completed    stackoverflow.com

I have some functions that I am calling and they take some time (milliseconds), but I don't want the page to display until these functions have completed. Right now, I ...

5. Where should I declare JavaScript files used in my page? In or near ?    stackoverflow.com

I was reading a tutorial and the author mentioned to include Javascript files near closing body tag (</body>) in HTML. I was wondering for what type of functionality I should not ...

6. Java Script function call on body load    stackoverflow.com

I have a java script function that i have called on body load mousemove() the function is working but the problem is that function is not overloading. Here is the code:

 ...

7. How to make document.body.onmousedown = ContextMouseDown; work in the other browsers?    stackoverflow.com

The lines below work in IE, what do I have to do so that it works in the other browsers?

document.body.onmousedown = ContextMouseDown;
document.body.oncontextmenu = ContextShow;
Thanks, R.

9. What does the JSLint error 'body of a for in should be wrapped in an if statement' mean?    stackoverflow.com

I used JSLint on a JavaScript file of mine. It threw the error:

for( ind in evtListeners ) {
Problem at line 41 character 9: The body of a ...

10. how to remove body onload function in java script?    stackoverflow.com

I met one critical problem in java script .....help me to fix this....... i have written the onload function in one jsp page say login.jsp... in tat function i used window.open method to ...

11. What is wrong with this simple javascript function to swap the CSS class of an HTML body?    stackoverflow.com

I've been staring at this for too long. I've put alerts throughout and the flow is correct. The styles exist. The body starts with the "styleBlack" class. ...

12. Can we add javascript in IE conditional comment just before     stackoverflow.com

This code should i place this code at bottom of body it's in conditional comment.

<!--[if lt IE 7]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta2)/IE7.js"></script>
<![endif]-->

13. Whats Pros and Cons: putting javascript in head and putting just before the body close    stackoverflow.com

Most of javascript and web development books/articles says that you must put CSS in the head tag and javascript at the bottom of the page. But when i open html source of ...

14. When does IE7 recompute styles? Doesn't work reliably when a class is added to the body    stackoverflow.com

I have an interesting problem here. I'm using a class on the element as a switch to drive a fair amount of layout behavior on my site. If the class is ...

15. qx.io.remote.Request: post parameters in body and url    stackoverflow.com

when creating and sending an http POST request like this...

        var req = new qx.io.remote.Request("/test","POST");
        req.setParameter("pi", "3.1415");
 ...

16. whats the substitute for a body onload?    stackoverflow.com

i have a javascript that i need to load at the body, but since im trying to build something flexible i really want it to function on a onLoad on a ...

17. How bad is it to embed JavaScript into the body of HTML?    stackoverflow.com

A team that I am working on has gotten into the habit of using <script> tags in random places in the body of our HTML pages. For example:

<html>
    ...

18. "document.body is null" is fixed now I get ".setStyle is not a function"    stackoverflow.com

I'm running into a similar problem as this: link text I've done the fix as in the answer but now I end up with an error a couple lines later:

$$([overlay = ...

19. Javascript - Function call will not enter function body    stackoverflow.com

I have a function acting as a constructor that, when called, gets as far as the function definition in the debugger, but never to the function body. Is there a ...

20. Calling JavaScript function before the end of body    stackoverflow.com

How do I call a JavaScript function before the end of the body of an HTML page?

21. disable/enable right click on a particular part of the html body    stackoverflow.com

i want to disable right click on the webpage but i want enable right click on textarea. Hey wat is this provide answers dont post lot of comments on right click ...

22. javascript in the     stackoverflow.com

I used to believe that you should not insert javascript blocks

<script language="javascript"> 
<!-- 
//--> 
</script> 
into the body part of a (what, HTML, XHTML?) document, but rather into the head. But is ...

23. Dynamically naming and implementing the body of a javascript function    stackoverflow.com

For simplicity's sake, I've included a script that dynamically calls a function by its name:

var foo = "hello";
var bar = "world";
var function_name = "say_" + foo + bar;

// Since its name ...

24. Should I write script in the body or the head of the html?    stackoverflow.com

I have seen both ways, both implementation work just the structures are a bit different. In your experience, which work better and why?

25. Getting a document.body error. help!    stackoverflow.com

I have the following JavaScript code:

function createNotification(title, body, canDismiss, callback)
{
    //create the container
    var nContainer = document.createElement("div");
    nContainer.setAttribute("id", "note"+title);
    ...

26. What does $(document.body) mean in javascript?    stackoverflow.com

What does it mean?

27. Javascript, fastest way to remove a class from ``    stackoverflow.com

I have a body element on which I add a few classes. And I want to remove the no-javascript class from it, after it's being read by the browser.

  ...

28. document.write resets body once    stackoverflow.com

When I used document.write after loading the body (via onclick event), it overwrites the entire body. I want this for what I'm trying to achieve. However, when I do it again, ...

29. Browser loading strategy, ...    stackoverflow.com

I am inspecting some interesting behaviors of browser, I don't know it's in standard or not. If I put everythin inside <head></head>, the browser will only begin to render the page ...

30. changing body class based on user's local time    stackoverflow.com

I'm trying to add a body class of 'day' if it's 6am-5pm and 'night' if "else" based on the user's local time. I tried the following but it didn't work. Any ideas? In ...

31. HTML doesn't stop    stackoverflow.com

I've got the following

<body onload="document.myform.submit()">
and it doesnt stop submitting the form. I think everytime it submits the form the page loads again and it submits it again and so on. ...

32. Monitor outgoing request body using nsihttpchannel    stackoverflow.com

I understand that nsIHttpChannel can be used to monitor and manipulate HTTP request/response headers.
However, I am unable to find a way to read the request body (POSTed data). Any pointers are ...

33. body onload="" cannot find function    stackoverflow.com

i am trying stuff with philogl library, and when i wrote,

<!DOCTYPE html>

<html>
<head>
    <title>PGL2</title>
    <script type="text/javascript" src="PhiloGL.js"></script>
    <script type="text/javascript">
    function ...

34. js script error in body.appendchild function    stackoverflow.com

var loc=window.location.href,width="500px",height="450px";
var a=document.createElement("div");

a.id="xyz";
a.style.position="fixed";
a.style.width="500px";
a.style.height="450px";
a.style.top="0px";
a.style.right="0px";

$('body').appendChild(a);
a.innerHTML='<iframe id="submit" width="500px" height="450px" src="http://abc.html"><iframe>';
this code gives the error Result of expression '$('body').appendChild' [undefined] is not a function. please help me as i cant figure out why this error is ...

35. document.body is null or not an object    stackoverflow.com

I am getting Java script error while loading page: document.body is null or not an object. URL: https://admit-uat.belgacom.be/WCE/ESW/selectBundle/productId/bun_nettv_go Can you please let me know what is the issue.

36. Including a Function on body onload isn't working    stackoverflow.com

I have a JavaScript function as shown

Event.observe(document, 'dom:loaded', function() {

    prettyPrint();

    HumbleFinance.trackFormatter = function (obj) {

        var ...

37. missing } after function body... even though everything is closed properly    stackoverflow.com

I'm trying to make a bookmarklet that first checks for jQuery on a page and loads the library if necessary, before loading my custom script. The script looks like this:

javascript:(function() {
 ...

38. javascript replace text in the html body    stackoverflow.com

is there a way to replace the normal text within a table element that is placed within the body of the html. like replacing ("hello" with "hi"). please only use javascript not jquery. thanks ...

39. JavaScript body onunload not working    stackoverflow.com

Hi I have the following code:

function redirect(){
     window.location.href='logged_out_chat.php';
}
...in my header and the following body tag:
<body onunload="javascript:redirect();">
...when i try this on one laptop, it redirects as it is ...

40. if (condition), then body onLoad javascript function    stackoverflow.com

I'm trying to load a popup login form ONLY when the person is logged in... but this doesn't seem to work...no error messages, but also no popup

<body ${$logged['member'] ? 'onLoad="Javascript:showPopupLoginForm();"' : ''}>
...

41. JavaScript defering    stackoverflow.com

Is placing <script> tags in just before closing the <body> tag the same sa placing them in the <head> section and specifying a defer="defer" attribute? Thank you.

42. set body width in px?    stackoverflow.com

how can you set the body width in px in javascript? has to work in chrome, ff and our beloved ie edit: it has to be used when a dialog box pops up and ...

43. JavaScript not working if placed inside the body of a web page?    stackoverflow.com

Hey I'm new to JavaScript and I've learned that JavaScript can be place between the <head></head> or <body></body> sections, I have been working in a project and it works fine inside ...

44. Body onload function in JavaScript    stackoverflow.com

I have the code that I have posted below in my webpage. As you can see it uses the body onload function to launch the script. Is there any way of ...

45. How do I move a Javascript phrase (within the body) into the head instead    stackoverflow.com

For example I have a code that drags in my twitter feed via a javascript file, I have pasted the links directly in the div I wish for it to appear ...

46. document.body.appendChild before page load    stackoverflow.com

Will it cause any issue if i include an iframe element before page load event

47. Call many functions in BODY    stackoverflow.com

Call many functions in BODY How can we call 2 functions (javascript) in onload of body in aspx? The functions are independent

48. Use JS to add browser version to or as class    stackoverflow.com

I'm trying to find a tried and tested script that sniffs the browser version and adds a suitably named class to the <html> or the <body> tags... like <html class="ie7"> or ...

49. changing body.style.overflowY or X programatically    stackoverflow.com

I'm trying to change the body overflowY to "hidden" through a JavaScript function. I've tried both of the following:

document.body.style['overflow-y'] = 'hidden';
document.body.style.overflowY = "hidden";
In both cases it didn't work. However in both ...

50. document.body.appendChild in place where the JS is included    stackoverflow.com

I want to append element after the<script> element that creates the element. It is for http://guubo.com/ multi-share service, so the purpose of the code is to create IFRAME element-button.

guubo ...

51. Set body left margin using Javascript    stackoverflow.com

Setting the body elements left margin using javascript does not work, it doesn't move? I dont know why this doesn't work? If I set the left margin using CSS it works but ...

52. Javascript replace undefined error shows!    stackoverflow.com

Friends i got quite some success but at the replace through an undefined error: here is my new code:

var avidno = '(800)123 1234';
var bodytext = document.body.innerHTML;
function validate () {
var regex = /^\(?([0-9]{3})\)?[-. ...

53. Javascript replace undefined error ends but not replace continues    stackoverflow.com

Possible Duplicate:
Javascript replace undefined error shows!
Friends i got success with this piece of code:
var avidno = '800.123.1234';
var bodytext = document.body.innerHTML;
var newbodytext;
function validate () {
var ...

54. Fade body away with simple javascript?    stackoverflow.com

I want to make a simple function to fade out the body onclick. Can it be done with javascript? I can use jquery if there is no other choice.

55. Document.body in Opera    stackoverflow.com

I've got a problem with retrieving link to the body tag. I've tried:

  1. document.body, unfortunately it is null
  2. search body by tagName while enumerating childs of document, it's found only the head tag ...

56. Missing body and unfounded error message on IE9    stackoverflow.com

I have a social network that allows users to post blogs and ask questions. If you click on the above links, you'll notice a commnunity blogs and ...

57. defining highcharts in body    stackoverflow.com

I'm trying to use highcharts in my system but the limitation of having to define the entire content and style of the highchart object in the < head > is destroying ...

58. Is there any movement in the standards body to support a safe way to copy to the clipboard?    stackoverflow.com

It seems like a general purpose need on the web that a page can copy something to the user's clipboard if the request is initiated by the user (not just by ...

59. Are external scripts in the head of an HTML document guaranteed to execute before scripts contained within the body?    stackoverflow.com

I'm trying to execute some inline javascript within an HTML page as early in page processing as possible that makes use of library functions in an external .js file. While ...

60. Loading a script in the section    stackoverflow.com

I have a javascript for a specific page that I do not wish to be loaded in my header section. Is it possible to load it in the section of ...

61. document.body.addEventListener is not working    stackoverflow.com

I'm working on a screen reader project and I needed to get the paragraph under the cursor. To do that in Firefox, I wrote an extension, to which my screen reader ...

62. Error "document.body.filters" in PNG fix (IE6)    stackoverflow.com

As part of a development, I met the transparency problem for PNG files in IE6 ... I found the following script and it works without problems except for some computers (with ...

63. Decrypt Salesforce text blob Body via Javascript    stackoverflow.com

I have some Javascript where I extract the Body of a static resource file:

function test() {
    var query = sforce.connection.query("Select Body from StaticResource where Name = 'StaticResourceFile'");
  ...

64. document.body.setAttribute not working in IE-7    stackoverflow.com

I have added "test.js" file in my .aspx page (in head section) . In test.js i added a script "document.body.setAttribute("onload", "testload()");" which is working well in IE-8-9 ,Mozilla ,Chrome ...

65. Add body #id based on url    stackoverflow.com

Need help! I've been looking for a solution for this seemingly simple task but can't find an exact one. Anyway, I'm trying to add custom #id to the tag based ...

66. Wrong body width in Linux Firefox    stackoverflow.com

I try to get body width in Linux Firefox. document.body.scrollWidth is equal to width which I can see in firefox window. So when I changed window size, document.body.scrollWidth is changed. But in Google Chrome, ...

67. Alternative to     stackoverflow.com

I'm trying to fix an old script written for me. I need it to run without <body onload="init ();">. I'd like to run the function from inside the script without inline ...

68. How to insert Javascript code in the body instead of Head in GreaseMonkey    stackoverflow.com

I need a javascript function to load first before calling it with GreaseMonkey. but it seems that GreaseMonkey always puts my code in the head of the html. How can I ...

69. JavaScript in or just before ?    stackoverflow.com

I am about to embark on a new web project and I plan to put my JS-scripts in the head and before end-body using the following scheme:

  1. Scripts that are essential for ...

70. body being pushed down    stackoverflow.com

I have been working on this site, http://hidden.xx The problem is that the <body> is pushed down about 20px from the top. And that is causing problems at the ...

71. Get body of function in JavaScript    stackoverflow.com

i am trying to get the body of a function in JavaScript but am unable to do so. Let's say I wanted to see the function body of the native toUpperCase() ...

72. Javascript, tying to write part of a function to body    stackoverflow.com

<head>

function codeAddress() {
        var address = document.getElementById("address").value;
        geocoder.geocode( { 'address': address}, function(results, status) {
    ...

73. Difference between document.body.contentEditable='true'; and document.designMode='on';    stackoverflow.com

The title says it all. It seems both allow to edit the document, so what's the difference?

74. JS: Attach body onload cross browser (methods comparison)    stackoverflow.com

I have examined Dean Edward's onload post and have a question: what's wrong with this onload attaching method? Where and why can it fail? And when is it safe ...

75. How to write in 'mailto' body link to current page    stackoverflow.com

I have mailto button in all pages of my site and I want to write reference to that page in e-mail body. In one page I can have

<a class="email" title="Email a friend" ...

76. document.documentElement.clientHeight returning a greater value than document.body.clientHeight     stackoverflow.com

i am doing some very simple javascript, so it seems rather silly to be asking such a basic question. I would appreciate if you will actually look at this seriously rather ...

77. how to replace text in the body using javascript    stackoverflow.com

I have the following code to replace all instances of "onAppDeactivate" with "onAppActivate" in the entire body of the document, but it doesn't seem to be working at all. Any ...

78. document.body.onload in Firefox    stackoverflow.com

Okay so I'm using Javascript to set the onload attribute of a page. It works in IE but not Firefox. Does anyone know a fix for this? Neither IE ...

79. body onload not working in IE browser    stackoverflow.com

I am using

<body marginheight='0' topmargin='0' leftmargin='0' onLoad='setFocus()'>
and in javascript I am using
<script language='JavaScript'>
function setFocus(){
  alert("Hello");
document.frm.txtName.focus()
} 
</script>
this is not working in IE but working perfectly in FF and chrome browsers any ...

80. Why document.body.scrollHeight can be greater than document.body.offsetHeight    stackoverflow.com

I need help with this two elements properties. According MDN element.scrollHeight "this a height of the scroll view of an element; it includes the element padding but not ...

81. external css in body of html file    stackoverflow.com

I have a question that bothers me on some projects I'm currently working on. This question is not a duplicate of What's the difference if I put css file inside ...

82. How can I access JavaScript defined in from     stackoverflow.com

For example suppose I have

function myTest() {
    return "test";
}
defined in <head> In body if I try to call myTest() it fails. How can I make functions and variables accessible ...

83. Search working in toolbar but not in body    stackoverflow.com

I am building a new template for displaying online help. I have a search field in the toolbar and the first page which calls dhtml_search.htm and in turn dhtml_search.js with two functions ...

84. Passing Value from Javascript method into HTML Body    coderanch.com

Thanks for replying... I tried using innerHTML but I am not getting the value....I think innerHTML is not working in my code.... this is my code where I am using innerHTML in script:-

86. document.body = null ?    codingforums.com

87. document.body.resolvechild showing type mismatch error in IE    codingforums.com

Hey this is my java script it works fine in FF , but in IE it shows type mismatch error .It shows my innerhtml page and also runs my script but i want to remove the type mismatch error would really appreciate your help.Thank you . Here is my javascript function function submitForm(){ // create request var xmlhttp = null; var ...

88. IE fails contentWindow.document.body for WYSIWYG    codingforums.com

Ok, so I'm working on a What-You-See-Is-What-You-Get editor, and it works flawlessly - with standards. I'm trying to work out bugs it has with IE, this one is particularly tricky: When the page loads, the editor should be inialized, and the inner HTML of the body of the iframe should set to specified text. This seems to work fine in standards-compliant ...

89. Body onload alternative?    codingforums.com

Please forgive me for asking what is likely obvious to everyone with programming bona fides,... I am looking for the html counterpart to the code above that Adios generously shared, so that I can include the following code (minus the "body window.onload", of course) into my html page.

91. Problem separating Body from Footer in CSS    codingforums.com

Problem separating Body from Footer in CSS Hey everyone, I'd like to know how to separate my body from the footer. Here is my code: [CODE] /* BODY */ html { background: url(http://website.com/wp-content/themes/portfolio/images/background.png) scroll; } body { text-align: left; font-family: Arial, Helvetica, sans-serif; font-size: 100%; background: url(http://website.com/wp-content/themes/portfolio/images/mainBG.png) repeat-y; margin-right: 137.2px; margin-left: 137.2px; margin-bottom: -500px; } a { text-decoration: none; } a:hover ...

92. body onFocus=functionname, not working on IE    codingforums.com

Hi, I'm working on a website and am having difficulty figuring out how to have a function triggered when the window becomes active. I am having limited success with: This works fine with Firefox and Safari, but not Internet Explorer. Is there a way to achieve this in all 3 browsers? Thanks.

94. Problem with     codingforums.com

95. before body onload...    codingforums.com

Hi, I am trying to run a JavaScript validation on a page. If the user has JavaScript turned off a light box with a JavaScript failure notice is not removed. If JavaScript is active this light box JavaScript failure notice is removed via DOM. Problem is that the function that removes this JavaScript failure notice is not being executed until after ...

96. Body onload not working with this? Why not?    codingforums.com

97. Body Onload    codingforums.com

If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing ...

98. script in the body section...    codingforums.com

function counter() { var theCounter = document.getElementById("counter") var thePlural = document.getElementById("plural") var plu = "items in cart" var sin = "item in cart" if (theCounter.innerHTML == 0) { theCounter.innerHTML = "No" thePlural.innerHTML = plu } else if (theCounter.innerHTML == 1) { thePlural.innerHTML = sin } else { thePlural.innerHTML = plu } }

99.     codingforums.com

yo peeps, i allready used following code to open a link in a new window with specifications , but how can i use it , that when my index.htm loads, a new window pops up with the site in it. A fixed 800*600 window. What do i need to enter in the body tag??? this is the JS i used: