/    Sign up×
Community /Pin to ProfileBookmark

add javascript to php page

what is the right way too add script to php page. i have the code with html and it work fin

[CODE]<!DOCTYPE html>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html;charset=utf-8″>
<link rel=”stylesheet” href=”./js/jquery.calendars.picker.css”>
<script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js”></script>
<script src=”./js/jquery.plugin.js”></script>
<script src=”./js/jquery.calendars.js”></script>
<script src=”./js/jquery.calendars.plus.js”></script>
<script src=”./js/jquery.calendars.picker.js”></script>
<!–<script src=”jquery.calendars.picker.ext.js”></script><!– Include for ThemeRoller styling –>
<script src=”./js/jquery.calendars.ummalqura.js”></script>
<script>
$(function() {

var calendar = $.calendars.instance(‘ummalqura’);
$(‘#popupDatepicker’).calendarsPicker({calendar: calendar});

});

function showDate(date) {
alert(‘The date chosen is ‘ + date);
}
</script>
</head>
<body>

<p><input type=”text” id=”popupDatepicker”></p>

</body>
</html>
[/CODE]

it is very important for me to work without html tag.

this is the Source link: [url]http://keith-wood.name/calendarspicker.html[/url]

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@ebrahimauthorNov 02.2014 — Views: 186 Replies: 0 !!!!! ?

still looking answer

how to add this script to php page ?

<script>

$(function() {

var calendar = $.calendars.instance('ummalqura');
$('#popupDatepicker').calendarsPicker({calendar: calendar});


});

function showDate(date) {

alert('The date chosen is ' + date);

}

</script>
Copy linkTweet thisAlerts:
@NogDogNov 02.2014 — Views: 186 Replies: 0 !!!!! ?

still looking answer

[/QUOTE]


Most of the "views" were probably people doing web searches looking for answers to their own questions, search engine bots, or people like me who don't understand your question. You add JavaScript -- which in the end is just additional mark-up within your HTML -- just like you add HTML to a PHP page.

example.php:
[code=php]
<?php
// this is a PHP page
?>
<!DOCTYPE html>
<html>
<head><title>Example PHP with JS</title></head>
<body>
<script type='text/javascrip'>alert('Hello, World.')</script>
</body>
</html>
<?php
// not sure why we bothered making this a PHP page?
?>
[/code]
Copy linkTweet thisAlerts:
@ebrahimauthorNov 02.2014 — It may be my question is not clear, but certainly I tyro in PHP so do not blame me on such a question, and thank you for your response.
Copy linkTweet thisAlerts:
@ginerjmNov 02.2014 — If Nogdog's answer is no help, then YES - your question is unclear. As he said - adding js to a php 'page' (actually the word is 'script') is exactly the same as adding html. But one part of your question is confusing. What do you mean by 'it is very important for me to work without html tag.'? That statement makes no sense either.

'
×

Success!

Help @ebrahim spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...