0

Hello i have a simple question and i need a simple solution
I have a javascript file named a pricing.js which contains this content in it

var price_arr = new Array('$ 16.95','$ 30.95','$ 49.95','$ 70.95','$ 99.95','$ 109.95','$ 139.95','$ 155.95','$ 199.95','$ 460.95');

but i want to to update this part of javascript file using PHP so please help me in this how can i update this part of the content from javascript file using php?

'$ 16.95','$ 30.95','$ 49.95','$ 70.95','$ 99.95','$ 109.95','$ 139.95','$ 155.95','$ 199.95','$ 460.95'
2
Contributors
3
Replies
21
Views
3 Years
Discussion Span
Last Post by diafol
0

Why don't you store this data in a php file and pass it to js on page load as json? Also - do you need the $ in the items? That would probably be easier to prepend as you write the values to the tags. Maybe.

Edited by diafol

0

Yes i am planning to do something like this it would be easier also but i was asking if there is a simple way to update the item vlues which converts usd prices along with the currency symbol in british pound and in euro with symbol and pre defined prices

Also i have an idea which is really simple which change the pre defined js files
e.g. if currency is USD then load pricing-usd.js
and if gbp or euro then load relavent pricing file (pring-'xcurrencyx'.js)
but i dont think its a professional thing
Can you suggest if this idea is a professional?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.