Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When opening our client front end in IE, I get the error "Object Expected" and it points to the following when I debug. I've googled, but nothing straightforward yet.

$(document).ready(function() {
$("#login_form").bind("submit", function() { processLogin(); return false; })

if ('<?php echo $_GET['email']?>' != '' && '<?php echo $_GET['password']?>' != '' ) {
    $('#login_form').submit();
}});
share|improve this question
    
Maybe something like this will be more suited to Stackoverflow? –  Sandeep Bansal May 19 '11 at 23:01
    
You're doing it wrong. –  Hello71 May 19 '11 at 23:09
add comment

1 Answer

You've got PHP in your JavaScript there, which is screwing up your JavaScript. Specifically, the opening ' in $_GET['email'] is being interpreted by JavaScript as the end of the string, and then it's trying to parse that bit after it as JavaScript code, which obviously it isn't.

Apparently your server is not processing this file through your PHP interpreter; fix that, though, and it looks like your JavaScript code is good (although I only took a cursory glance through it, so I claim no responsibility if it's still broken!).

share|improve this answer
    
What's obnoxious is that it works in EVERY other browser. I've tried changing out quotes so that it recognizes as php and not js, but still no go. What would be a better way of doing it? document.write? Something along the lines more of an echo? I'm kinda stuck. –  Joseph May 23 '11 at 22:05
    
@Joseph It shouldn't work in any browser -- that is invalid JavaScript code, because your server is apparently not processing the PHP. –  Kromey May 23 '11 at 22:08
    
I replaces the random php with document.write to separate it out, but still doing it. I can confirm that it works in FF, Chrome and Safari. Whatever the reasons. Any proposed fix? –  Joseph May 23 '11 at 23:01
    
@Joseph I'd have to see your updated code. However, as @Sandeep has suggested, this is a programming question and more relevant to Stackoverflow, where you will most likely get better responses than you would here. –  Kromey May 23 '11 at 23:11
    
@Kromney. Okay. I'll repost over there. Thanks for the help :-) –  Joseph May 23 '11 at 23:12
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.