Justin Collins
6/4/2009 9:42:00 AM
Jerry Lane wrote:
> I am trying to use this but not sure how to implement it. I just want to
> check after x seconds if page is loading so was trying something like:
>
> sleep (10)
>
> pageCheck = READYSTATE_COMPLETE = 4
>
> if pageCheck = true
> puts 'test passed'
> else
> puts 'epic fail'
> end
>
> Any ideas where I am going disasterously wrong?
>
'=' is for assignment, '==' is for comparison.
sleep (10)
pageCheck = READYSTATE_COMPLETE = 4 # This sets pageCheck and READYSTATE_COMPLETE to 4
if pageCheck = true # This sets pageCheck to true
puts 'test passed'
else
puts 'epic fail'
end
It's hard to tell exactly what you are trying to do, but I _think_ you
want something more like
if READYSTATE_COMPLETE == 4
puts 'test passed'
else
puts 'epic fail'
end
or if you need pageCheck later
pageCheck = READYSTATE_COMPLETE == 4
if pageCheck
puts 'test passed'
else
puts 'epic fail'
end
-Justin