![]() |
| ||
| .js references from content to master don't work Hi, I'm having this problem and can't get a solution anywhere. -- <Introduction:> I have a master page, then I have a content page which contains a little login form wrapped in <div id="LoginTable"></div> What I want, is to use a ScriptaculoUs JavaScript Effect.Highlight(...) on some mouseovers. The Effect.Highlight is in external .js file. Scriptaculous uses also Prototype. --<Problem> On a standalone page it worked fine, I referenced the "Scriptaculous.js" and "Prototype.js" in the <head> tags, then I added a <script> tag with a function: HiEffect(element){ Effect.Highlight(...) } then I added onmouseover="HiEffect(this)" to the element. Everything worked fine until I had to put this page under a MasterPage. Now, even if I reference the files in the MasterPage or ContentPage, the script won't run. --<What Worked> I tried instead of putting Effect.Highlight() something regular, like alert("lol") and the mouseover worked, so OK, the <script> can be found. Then I checked if the element can be found, Yes, it is found. So the problem surely is in the reference to the external .js file. Where to put it, or how to force the page to know where to look for it? Does anyone know, please let me know, thanx a lot. |
| ||
| Re: .js references from content to master don't work lol 230 views, and nobody can help? maybe it is a big problem, or was I misunderstood? |
| ||
| Re: .js references from content to master don't work It really helps if you can post some code, or link to some code, and include any error messages. |
| ||
| Re: .js references from content to master don't work Aw, yes, sorry. this is my master Page: <head runat="server"> this is my content Page: <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" Title="Login" %>the table goes on, but it is not important. codebehind files are also not important. What this is doing: When the page loads, the <div> 'LoginTable' should appear slowly. ERROR messages. Yes, I use Firebug and it tells me this: Effect is not defined: Effect.Appear(elem, { duration: 2.0 }) So it is obvious that the external file effects.js cannot be found. I know I don't need to put the <script> reference to effects.js, because the file scriptaculous.js loads it itself, but still, the file can not be found or what. hope this helps, thx. |
| ||
| Re: .js references from content to master don't work WHAT THE HELL? I resolved it by accident. I almost gave up. I simply moved the <script> references from the <head> of the Master Page into the <body><form> tag and it worked... lol, I spent hours googling around and found nothing. :'( :@ I Hope if anybody`s got this noob (that`s me) problem, here is the solution. Anyway, thanx Drew, and to everybody who wanted to help :) |
| All times are GMT -4. The time now is 8:12 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC