Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have the problem of running this. I get back an error stating that I either am missing a ) after arguments or that I have an illegal character. I understand that it must be thinking that I am trying to insert an argument when I am not. I believe I just need help with the syntax.

    browser.execute_script("url = '/Administration/SwitchCompany?' + jQuery.param({CompanyId: $('#companyDropDownList option:contains('DTLTest')').val() })")

browser.execute_script("$('#userInfoPlaceholder').load(url, switchCompanyCallback);" )
share|improve this question

2 Answers 2

Did you mean

browser.execute_script("$('#userInfoPlaceholder').load(url, switchCompanyCallback);" )

Change of # to $

share|improve this answer
    
that was a mistake writing it into the forum. But in my code that is not there. Still doesn't work –  user2701698 Aug 8 '14 at 23:20

You have single quotes inside of single quotes in your javascript:

$('#companyDropDownList option:contains('DTLTest')')

If you switch the quotes around the full Python string to triple quotes, you could use both single and double quotes in your javascript. Otherwise, you'll need to do some escaping.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.