Why Register With OSV?

Join 5700+ of your peers

Get enriched. Access 1270+ quality tutorials right away on:

  • Joomla 2.5.X, 3.0.X
  • WordPress 3.5.X
  • Shopping Carts
  • E-Commerce Payment Gateways
  • PDFs for each tutorial - FREE for download
  • New topics and tutorials added weekly

FREE EBooks

FREE Templates

Member Login

Not a member yet? Sign Up!

Opensourcevarsity Logo
Tutorials & Training from experienced world class trainers
Welcome, Guest
Username Password: Remember me

how to get multiple scripts to work on single page
(1 viewing) (1) Guest
All your queries regarding JavaScript will be solved in this forum
  • Page:
  • 1

TOPIC: how to get multiple scripts to work on single page

how to get multiple scripts to work on single page 11 months, 2 weeks ago #1075

  • suny
  • OFFLINE
  • Senior Boarder
  • Posts: 50
  • Karma: 0
Does anyone know how to get multiple scripts to work on a single page?

Re: how to get multiple scripts to work on single page 11 months, 2 weeks ago #1083

  • yusuf
  • OFFLINE
  • Junior Boarder
  • Posts: 27
  • Karma: 0
"The short (not recommend) answer is to rename all of the variable and function names in the second instance of the

script thus preventing them from conflicting.

The longer (recommend) answer would be to rewrite the script in an object-oriented fashion. The reason you'd do it like this

is because this is inherently how object-oriented code is intended to work: with multiple instances. This is true because

when you call the constructor for that object, all variables become internal properties of it therefore completely removing

the chance of anything conflicting between the two scripts. Also note by making it an object you can have as many instances

of it on a page as you'd like — it's not only limited to two."
  • Page:
  • 1
Time to create page: 1.17 seconds
O-S-V Free Templates

FREE HTML / Joomla / WordPress Templates For Download
Registration Required

CONNECT WITH US

Sitemap   |   Privacy Policy   |   MySQL(70)   |   Disclaimer   |   Reach Out To Us
Designed by Ivan Bayross & Meher Bala | Powered by Joomla
© 2013 All Rights Reserved.