₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,344,951 members, 8,514,656 topics. Date: Saturday, 07 November 2026 at 02:11 AM

Toggle theme

Javascript - Webmasters - Nairaland

Nairaland Forum › Science/Technology › Webmasters › Javascript (557 Views)

1 Reply

Javascript by cassyemmanuels(op): 1:08am On Nov 27, 2018
Hello guys I need assist on something in javascript, my code is working only in index page and not in all other pages..
Re: Javascript by Nobody: 2:24am On Nov 27, 2018
cassyemmanuels:
Hello guys I need assist on something in javascript, my code is working only in index page and not in all other pages..
be sure to include the JavaScript file in the other pages too
Re: Javascript by cassyemmanuels(op): 7:56am On Nov 27, 2018
Bro thank you so much for the reply, but the issue at hand is take for instance a php website with multiple pages, were the header and footer is in different files using php include statement to include the header and footer i. e <?php include "header" ; ?>
And an external javascript file linked in the header or footer. I. e for instance <javascript src="mm.Js">
And a button located in the header page, since the header is included in all pages, that makes the one button appear in all pages, the button is to trigger a javascript function inside the linked javascript file for instance a function to alert "hello world ", now when the button is clicked on the index page it triggers the function but when the same button is clicked in the other pages the function Will not be triggered...
1 Reply

Please I Need Help With This Javascript Issue • #get Responsive Website Developed Fast In Short Time. #php, #javascript.... • Build A Github Repository Finder App 2019 Using Javascript (FOR BEGINNERS) • 2 • 3 • 4

Security For Word Press: Techniques To Create An Anti-hacking Fortress • I Need Nigerian Google Adsense Account, With Dot Com Domain Name To Buy • Paypal Account For Sale