jQuery Not Loading

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 12 años
Hello Friends

I hope someone can help me with this weird issue I am having.

I am inserting some custom jQuery code into [ Views/Customer/Login.cshtml ] and it is not loading. I have no idea why !

I would greatly appreciate any help, here's the code:

<script type="text/javascript">
$(document).ready(function(){
    if ($.browser.msie) {
        $('.username').focus(fuction(){
            alert('boo');
        });

        $('.email').focus(fuction(){
            alert('foo');
        });
    }
});
</script>

Thank You.
Hace 12 años
Ciwan wrote:
Hello Friends

I hope someone can help me with this weird issue I am having.

I am inserting some custom jQuery code into [ Views/Customer/Login.cshtml ] and it is not loading. I have no idea why !

I would greatly appreciate any help, here's the code:

<script type="text/javascript">
$(document).ready(function(){
    if ($.browser.msie) {
        $('.username').focus(fuction(){
            alert('boo');
        });

        $('.email').focus(fuction(){
            alert('foo');
        });
    }
});
</script>

Thank You.



If you can see that the required jquery references exist then I would add an else statement to that if and see if it gets fired. Maybe $.browser.msie is coming back undefined.
Hace 12 años
You were right Skyler. $.browser seems to have been removed !

I have got the following now, but it is still not working.

<!--[if IE]>
<script type="text/javascript">
    $(document).ready(function () {
        $(".username").val("Your Username");
    });
</script>
<![endif]-->

.username is a class applied to an input of type text.
Hace 12 años
Ciwan wrote:
You were right Skyler. $.browser seems to have been removed !

I have got the following now, but it is still not working.

<!--[if IE]>
<script type="text/javascript">
    $(document).ready(function () {
        $(".username").val("Your Username");
    });
</script>
<![endif]-->

.username is a class applied to an input of type text.


Curious. Believe it or not I've never used these types of conditional elements, but nothing stands out here. Maybe a typo on the element?
Hace 12 años
nope I checked that like a 100 times, it is spelt correctly :s

Even this doesn't work when imported into nopCommerce.

Which leads me to think that something within nopCommerce is messing it up. Cause in their demo .. it does work on IE, but not in my nopCommerce. :(
Hace 12 años
Ciwan wrote:
nope I checked that like a 100 times, it is spelt correctly :s

Even this doesn't work when imported into nopCommerce.

Which leads me to think that something within nopCommerce is messing it up. Cause in their demo .. it does work on IE, but not in my nopCommerce. :(


Could you post your html change? Or part of it?


                            @if (Model.UsernamesEnabled)
                            {
                                <tr class="row">
                                    <td class="item-name">
                                        @Html.LabelFor(m => m.UserName):
                                    </td>
                                    <td class="item-value">
                                        @Html.TextBoxFor(m => m.UserName)
                                        @Html.ValidationMessageFor(m => m.UserName)
                                    </td>
                                </tr>
                            }


Hace 12 años
lol that was exactly it. The username stuff wasn't being generated, because they were turned off from the admin cp. It now works. :)

Thanks so much.
Hace 12 años
Ciwan wrote:
lol that was exactly it. The username stuff wasn't being generated, because they were turned off from the admin cp. It now works. :)

Thanks so much.


HA! Glad I could help. That kind of thing happens to all of us.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.