Yii Framework Forum: How To Import Js File From Another Source - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How To Import Js File From Another Source Rate Topic: -----

#1 User is offline   Trinh Duy Hung 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 26-October 12

Posted 03 March 2013 - 10:33 PM

Hello everyone!

I need to include a java script from another site like this:

<script type="text/javascript" src="http://www.vietbando.com/maps/API/VBDMapAPI.js?key=e7vjH+pgQHuSyV75dwG6htTwfYPMEaPVHQOH83PR6F="></script>


How do I use the yii way to implement above code?

Thanks in advanced!
0

#2 User is offline   rootbear 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 222
  • Joined: 17-June 11

Posted 03 March 2013 - 11:16 PM

Yii::app()->getClientScript()->registerScriptFile("http://www.vietbando.com/maps/API/VBDMapAPI.js?key=e7vjH+pgQHuSyV75dwG6htTwfYPMEaPVHQOH83PR6F=");


however, it's no different than include manually for this particular one. since it's some kind of dynamic content. no /assets/ created.

if it's static js file from other site, it would be no differnt than your local copy. /assets/ copy created
I enjoy the Yii.sy coding life here.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users