Wrong syntax. createRatioSlider requires 2 arguments, GPIO Pin and Ratio
See this page below
http://webiopi.trouch.com/JAVASCRIPT.htmlYou also need to seup the pin as PWM GPIO.PWM not GPIO.OUT
so change this line to:
def setup():
GPIO.setFunction(PWM1,GPIO.PWM)
in your script.py
In your html page you can change the line to
button = webiopi().createRatioSlider(20,50);
Last number is slider initial value.
Testing this with a LED in series with a 390ohm resistor.
As the duty cycle changes, the LED brightness does too.
One last point, the voltage on the PWM pin will always be 3.3V or 0V its the amount
of on/off time that varies. Most digital meters can onlt take 3 readings/second so may not
give a true reading. At 40% PWM for example the voltage on my meter read 1.15V , but
its to slow to read the fast PWM pulses.
Hope that helps