Skip to content
Advertisement

Tag: javascript

Cakephp: how to pass values into a javascript file?

I have some javascript that is being included in a view and I used inkedmn’s method in this thread: adding-page-specific-javascript-to-each-view-in-cakephp So I now have the following code in my view: But I need to pass some values from the view into the javascript file and I’m unsure of how to accomplish this. Update: I guess one option would be to

Javascript Equivalent to PHP Explode()

I have this string: 0000000020C90037:TEMP:data I need this string: TEMP:data. With PHP I would do this: How do I effectively explode a string in JavaScript the way it works in PHP? Answer This is a direct conversion from your PHP code:

how to include js file in php?

I have a problem with an js file in php. if i include it like this: the file isn’t included and i get an error that the function isn’t defined. When i try it this way: the first tag in the document.write function closes <script type=”text/javascript”> what is the correct way to do this? thanks, sebastian Answer PHP is completely

Passing Value Including Spaces on Ajax Call

Trying to pass spaces along with ajax call. ‘word’ is been passed the same as ‘word ‘ i believe so. On the other hand two words need to be send completely with call. ‘word second’ but not the same as ‘word second ‘ Should I trim before call or do this on server side script? How can I send spaces

Save Google map to jpeg using PHP?

Is it even possible? I am implementing an export to pdf functionality for a pile of data, one of which is a Google map with a marker. Thank you. Answer I think you are looking for this: http://code.google.com/apis/maps/documentation/staticmaps/ you just need the url and the google api returns the google maps excerpt as a png file

Preventing JavaScript Injections in a PHP Web Application

What are the measures needed to prevent or to stop JavaScript injections from happening in a PHP Web application so that sensitive information is not given out (best-practices in PHP, HTML/XHTML and JavaScript)? Answer A good first step is applying the methods listed in the question Gert G linked. This covers in detail the variety of functions that can be

Advertisement