Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Question

deleted 1 character in body
Source Link
Kamil Kiełczewski
  • 93.8k
  • 34
  • 402
  • 375

Traditionally, to call a JavaScript function once the page has loaded, you'd add an onload attribute to the body containing a bit of JavaScript (usually only calling a function):

<body onload="foo()">

When the page has loaded, I want to run some JavaScript code to dynamically populate portions of the page with data from the server. I can't use the onload attribute since I'm using JSP fragments, which have no body element I can add an attribute to.

Is there any other way to call a JavaScript function on load? I'd rather not use jQuery as I'm not very familiar with it.

Traditionally, to call a JavaScript function once the page has loaded, you'd add an onload attribute to the body containing a bit of JavaScript (usually only calling a function):

<body onload="foo()">

When the page has loaded, I want to run some JavaScript code to dynamically populate portions of the page with data from the server. I can't use the onload attribute since I'm using JSP fragments, which have no body element I can add an attribute to.

Is there any other way to call a JavaScript function on load? I'd rather not use jQuery as I'm not very familiar with it.

Traditionally, to call a JavaScript function once the page has loaded, you'd add an onload attribute to the body containing a bit of JavaScript (usually only calling a function)

<body onload="foo()">

When the page has loaded, I want to run some JavaScript code to dynamically populate portions of the page with data from the server. I can't use the onload attribute since I'm using JSP fragments, which have no body element I can add an attribute to.

Is there any other way to call a JavaScript function on load? I'd rather not use jQuery as I'm not very familiar with it.

Question Protected by Community Bot
Change title, fix typos, and reword body.
Source Link
icktoofay
  • 129.6k
  • 23
  • 261
  • 239

How todo I call a JavaScript function on page load?

How can ITraditionally, to call a JavaScript function ononce the page load without makinghas loaded, you'd add an onload attribute to the body containing a bit of JavaScript (usually only calling a function):

<body onload='callFunctiononload="foo()'>">

i want to check when loadingWhen the page what is the purposehas loaded, I want to run some JavaScript code to dynamically populate portions of using thatthe page, if for addition then ok , if for edition , there will be with data come from the server to be displayed in that page, so i want to check. I can't use the request each time page is loaded ,onload attribute since i don'tI'm using JSP fragments, which have body tag in my page cz i use jspf (JSP Fragment)no body element I can add an attribute to. NOTE : i don't know jQuerry , is there's another

Is there any other way to call a JavaScript function on load? I'd rather not use jQuery as I'm not very familiar with it.

How to call a JavaScript function on page load

How can I call a JavaScript function on page load without making

<body onload='callFunction()'>

i want to check when loading the page what is the purpose of using that page, if for addition then ok , if for edition , there will be data come from server to be displayed in that page, so i want to check the request each time page is loaded , since i don't have body tag in my page cz i use jspf (JSP Fragment) . NOTE : i don't know jQuerry , is there's another way?

How do I call a JavaScript function on page load?

Traditionally, to call a JavaScript function once the page has loaded, you'd add an onload attribute to the body containing a bit of JavaScript (usually only calling a function):

<body onload="foo()">

When the page has loaded, I want to run some JavaScript code to dynamically populate portions of the page with data from the server. I can't use the onload attribute since I'm using JSP fragments, which have no body element I can add an attribute to.

Is there any other way to call a JavaScript function on load? I'd rather not use jQuery as I'm not very familiar with it.

added 306 characters in body
Source Link
palAlaa
  • 9.9k
  • 34
  • 110
  • 170

How docan I call a JavaScript function on page load without making

 <body onload='callFunction()'>

Ii want another way to call methodcheck when loading the page loadwhat is the purpose of using that page, can someone help if for addition then ok , if for edition , there will be data come from server to be displayed in that page, so i want to check the request each time page is loaded , since i don't have body tag in my page cz i use jspf (JSP Fragment) . NOTE : i don't know jQuerry , is there's another way?

How do I call a JavaScript function on page load without making

 <body onload='callFunction()'>

I want another way to call method when page load, can someone help?

How can I call a JavaScript function on page load without making

 <body onload='callFunction()'>

i want to check when loading the page what is the purpose of using that page, if for addition then ok , if for edition , there will be data come from server to be displayed in that page, so i want to check the request each time page is loaded , since i don't have body tag in my page cz i use jspf (JSP Fragment) . NOTE : i don't know jQuerry , is there's another way?

Rollback to Revision 3
Source Link
STW
  • 46.8k
  • 17
  • 109
  • 170
Loading
Rollback to Revision 2
Source Link
STW
  • 46.8k
  • 17
  • 109
  • 170
Loading
spelling corrections
Source Link
STW
  • 46.8k
  • 17
  • 109
  • 170
Loading
added 12 characters in body; edited title; edited title
Source Link
kemiller2002
  • 115.8k
  • 28
  • 202
  • 255
Loading
Source Link
palAlaa
  • 9.9k
  • 34
  • 110
  • 170
Loading
lang-js

AltStyle によって変換されたページ (->オリジナル) /