javascript function not executing...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gary Varga

    #1

    javascript function not executing...

    Are you getting confused between client and server?

    Should it be:
    [color=blue]
    >
    >Source Error:
    >
    >Line 39:
    >Line 40: <DIV ID=divOverview
    >Line 41: STYLE=CustomHei ghtedStyle()
    >Line 42: align=center ms_positioning= "FlowLayout ">
    >Line 43:
    >[/color]

    HTH,
    Gaz
    [color=blue]
    >-----Original Message-----
    >I'm trying to set the height of a DIV through the style,[/color]
    by using the frame[color=blue]
    >(orderscontrol ) height and subtracting a buffer space[/color]
    used for some buttons[color=blue]
    >but the function in the script tags doesn't even run. I[/color]
    get the error...[color=blue]
    >
    >############## ####
    >#
    >#
    >
    >Compilation Error
    >Description: An error occurred during the compilation of[/color]
    a resource required[color=blue]
    >to service this request. Please review the following[/color]
    specific error details[color=blue]
    >and modify your source code appropriately.
    >
    >Compiler Error Message: BC30451:[/color]
    Name 'CustomHeighted Style' is not declared.[color=blue]
    >
    >Source Error:
    >
    >Line 39:
    >Line 40: <DIV ID=divOverview
    >Line 41: STYLE='<%=Custo mHeightedStyle( )%>'
    >Line 42: align=center ms_positioning= "FlowLayout ">
    >Line 43:
    >
    >#
    >#
    >############## #######
    >
    >
    >
    >and here's the HTML from the aspx page.
    >
    >
    >
    >############## ############### ##
    >#
    >#
    >
    ><body MS_POSITIONING= "GridLayout ">
    >
    ><SCRIPT LANGUAGE=javasc ript>
    >
    > function CustomHeightedS tyle()
    > {
    > var frmHeight = parent.ordersco ntrol.height
    > var divHeight = frmHeight - 63
    > var divStyle = "Z-INDEX: 102; " +
    > "LEFT: 0px; " +
    > "OVERFLOW: auto; " +
    > "WIDTH: 100%; " +
    > "POSITION: absolute; " +
    > "TOP: 61px; HEIGHT: " +
    > frmHeight.toStr ing() + "px"
    > return divStyle
    > }
    >
    ></SCRIPT>
    >
    ><form id=controls method=post runat="server">
    >
    ><DIV ID=divOverview
    >STYLE='<%=Cust omHeightedStyle ()%>'
    >align=center ms_positioning= "FlowLayout ">
    >
    >....some stuff...
    >
    ></DIV></FORM></BODY>
    >
    ></HTML>
    >
    >#
    >#
    >############## ############### ##
    >
    >I've tried usnig the "javascript :" prefix in the element[/color]
    tag, but then the[color=blue]
    >error reads that 'javascript' is undefined.
    >your help is appreciated, thanks
    >Dan.
    >
    >
    >.
    >[/color]
  • \(Liquid\) Daniel Bass

    #2
    Re: javascript function not executing...

    doesn't it have to be client side since i want to get the containment
    frame's height, then apply that to a DIV attribute?

    "Gary Varga" <MSNG@VargaLtd. freeserve.co.uk > wrote in message
    news:0c2301c34d 1f$5963e630$a40 1280a@phx.gbl.. .[color=blue]
    > Are you getting confused between client and server?
    >
    > Should it be:
    >[color=green]
    > >
    > >Source Error:
    > >
    > >Line 39:
    > >Line 40: <DIV ID=divOverview
    > >Line 41: STYLE=CustomHei ghtedStyle()
    > >Line 42: align=center ms_positioning= "FlowLayout ">
    > >Line 43:
    > >[/color]
    >
    > HTH,
    > Gaz
    >[color=green]
    > >-----Original Message-----
    > >I'm trying to set the height of a DIV through the style,[/color]
    > by using the frame[color=green]
    > >(orderscontrol ) height and subtracting a buffer space[/color]
    > used for some buttons[color=green]
    > >but the function in the script tags doesn't even run. I[/color]
    > get the error...[color=green]
    > >
    > >############## ####
    > >#
    > >#
    > >
    > >Compilation Error
    > >Description: An error occurred during the compilation of[/color]
    > a resource required[color=green]
    > >to service this request. Please review the following[/color]
    > specific error details[color=green]
    > >and modify your source code appropriately.
    > >
    > >Compiler Error Message: BC30451:[/color]
    > Name 'CustomHeighted Style' is not declared.[color=green]
    > >
    > >Source Error:
    > >
    > >Line 39:
    > >Line 40: <DIV ID=divOverview
    > >Line 41: STYLE='<%=Custo mHeightedStyle( )%>'
    > >Line 42: align=center ms_positioning= "FlowLayout ">
    > >Line 43:
    > >
    > >#
    > >#
    > >############## #######
    > >
    > >
    > >
    > >and here's the HTML from the aspx page.
    > >
    > >
    > >
    > >############## ############### ##
    > >#
    > >#
    > >
    > ><body MS_POSITIONING= "GridLayout ">
    > >
    > ><SCRIPT LANGUAGE=javasc ript>
    > >
    > > function CustomHeightedS tyle()
    > > {
    > > var frmHeight = parent.ordersco ntrol.height
    > > var divHeight = frmHeight - 63
    > > var divStyle = "Z-INDEX: 102; " +
    > > "LEFT: 0px; " +
    > > "OVERFLOW: auto; " +
    > > "WIDTH: 100%; " +
    > > "POSITION: absolute; " +
    > > "TOP: 61px; HEIGHT: " +
    > > frmHeight.toStr ing() + "px"
    > > return divStyle
    > > }
    > >
    > ></SCRIPT>
    > >
    > ><form id=controls method=post runat="server">
    > >
    > ><DIV ID=divOverview
    > >STYLE='<%=Cust omHeightedStyle ()%>'
    > >align=center ms_positioning= "FlowLayout ">
    > >
    > >....some stuff...
    > >
    > ></DIV></FORM></BODY>
    > >
    > ></HTML>
    > >
    > >#
    > >#
    > >############## ############### ##
    > >
    > >I've tried usnig the "javascript :" prefix in the element[/color]
    > tag, but then the[color=green]
    > >error reads that 'javascript' is undefined.
    > >your help is appreciated, thanks
    > >Dan.
    > >
    > >
    > >.
    > >[/color][/color]


    Comment

    • Gary Varga

      #3
      Re: javascript function not executing...

      Exactly!!!

      That is why I removed the <%= %> from around the CLIENT
      side function as it does not exist on the SERVER yet the
      <% %> surrounds SERVER code.

      (I used capitals as emphasis - not slight is intended).

      HTH,
      Gaz
      [color=blue]
      >-----Original Message-----
      >doesn't it have to be client side since i want to get[/color]
      the containment[color=blue]
      >frame's height, then apply that to a DIV attribute?
      >
      >"Gary Varga" <MSNG@VargaLtd. freeserve.co.uk > wrote in[/color]
      message[color=blue]
      >news:0c2301c34 d1f$5963e630$a4 01280a@phx.gbl. ..[color=green]
      >> Are you getting confused between client and server?
      >>
      >> Should it be:
      >>[color=darkred]
      >> >
      >> >Source Error:
      >> >
      >> >Line 39:
      >> >Line 40: <DIV ID=divOverview
      >> >Line 41: STYLE=CustomHei ghtedStyle()
      >> >Line 42: align=center ms_positioning= "FlowLayout ">
      >> >Line 43:
      >> >[/color]
      >>
      >> HTH,
      >> Gaz
      >>[color=darkred]
      >> >-----Original Message-----
      >> >I'm trying to set the height of a DIV through the[/color][/color][/color]
      style,[color=blue][color=green]
      >> by using the frame[color=darkred]
      >> >(orderscontrol ) height and subtracting a buffer space[/color]
      >> used for some buttons[color=darkred]
      >> >but the function in the script tags doesn't even run.[/color][/color][/color]
      I[color=blue][color=green]
      >> get the error...[color=darkred]
      >> >
      >> >############## ####
      >> >#
      >> >#
      >> >
      >> >Compilation Error
      >> >Description: An error occurred during the compilation[/color][/color][/color]
      of[color=blue][color=green]
      >> a resource required[color=darkred]
      >> >to service this request. Please review the following[/color]
      >> specific error details[color=darkred]
      >> >and modify your source code appropriately.
      >> >
      >> >Compiler Error Message: BC30451:[/color]
      >> Name 'CustomHeighted Style' is not declared.[color=darkred]
      >> >
      >> >Source Error:
      >> >
      >> >Line 39:
      >> >Line 40: <DIV ID=divOverview
      >> >Line 41: STYLE='<%=Custo mHeightedStyle( )%>'
      >> >Line 42: align=center ms_positioning= "FlowLayout ">
      >> >Line 43:
      >> >
      >> >#
      >> >#
      >> >############## #######
      >> >
      >> >
      >> >
      >> >and here's the HTML from the aspx page.
      >> >
      >> >
      >> >
      >> >############## ############### ##
      >> >#
      >> >#
      >> >
      >> ><body MS_POSITIONING= "GridLayout ">
      >> >
      >> ><SCRIPT LANGUAGE=javasc ript>
      >> >
      >> > function CustomHeightedS tyle()
      >> > {
      >> > var frmHeight = parent.ordersco ntrol.height
      >> > var divHeight = frmHeight - 63
      >> > var divStyle = "Z-INDEX: 102; " +
      >> > "LEFT: 0px; " +
      >> > "OVERFLOW: auto; " +
      >> > "WIDTH: 100%; " +
      >> > "POSITION: absolute; " +
      >> > "TOP: 61px; HEIGHT: " +
      >> > frmHeight.toStr ing() + "px"
      >> > return divStyle
      >> > }
      >> >
      >> ></SCRIPT>
      >> >
      >> ><form id=controls method=post runat="server">
      >> >
      >> ><DIV ID=divOverview
      >> >STYLE='<%=Cust omHeightedStyle ()%>'
      >> >align=center ms_positioning= "FlowLayout ">
      >> >
      >> >....some stuff...
      >> >
      >> ></DIV></FORM></BODY>
      >> >
      >> ></HTML>
      >> >
      >> >#
      >> >#
      >> >############## ############### ##
      >> >
      >> >I've tried usnig the "javascript :" prefix in the[/color][/color][/color]
      element[color=blue][color=green]
      >> tag, but then the[color=darkred]
      >> >error reads that 'javascript' is undefined.
      >> >your help is appreciated, thanks
      >> >Dan.
      >> >
      >> >
      >> >.
      >> >[/color][/color]
      >
      >
      >.
      >[/color]

      Comment

      • \(Liquid\) Daniel Bass

        #4
        Re: javascript function not executing...

        This ain't working...
        I'll scrap the javascript idea.
        All I want to do is have a control, header section across the top of a page,
        then a DIV beneath it so that the control doesn't scroll, but the DIV in the
        rest of the body does. In other words, simulating frame behaviour with a top
        banner/control static section and scrollable view beneath it with DIV tags.
        The problem is DIV doesn't automattically take up the remaining space so the
        idea behind my javascript was have something like

        the height of the DIV element = the height of the frame - the height of
        my control panel

        is there another way around this? I goto the help section in the style sheet
        say, and the help page does what i want to do, so i look at the source there
        and it also uses DIV's, but I can't replicate the behaviour...

        thanks again.
        Dan.


        "Gary Varga" <MSNG@VargaLtd. freeserve.co.uk > wrote in message
        news:0a0501c34d 27$17d76040$a60 1280a@phx.gbl.. .[color=blue]
        > Exactly!!!
        >
        > That is why I removed the <%= %> from around the CLIENT
        > side function as it does not exist on the SERVER yet the
        > <% %> surrounds SERVER code.
        >
        > (I used capitals as emphasis - not slight is intended).
        >
        > HTH,
        > Gaz
        >[color=green]
        > >-----Original Message-----
        > >doesn't it have to be client side since i want to get[/color]
        > the containment[color=green]
        > >frame's height, then apply that to a DIV attribute?
        > >
        > >"Gary Varga" <MSNG@VargaLtd. freeserve.co.uk > wrote in[/color]
        > message[color=green]
        > >news:0c2301c34 d1f$5963e630$a4 01280a@phx.gbl. ..[color=darkred]
        > >> Are you getting confused between client and server?
        > >>
        > >> Should it be:
        > >>
        > >> >
        > >> >Source Error:
        > >> >
        > >> >Line 39:
        > >> >Line 40: <DIV ID=divOverview
        > >> >Line 41: STYLE=CustomHei ghtedStyle()
        > >> >Line 42: align=center ms_positioning= "FlowLayout ">
        > >> >Line 43:
        > >> >
        > >>
        > >> HTH,
        > >> Gaz
        > >>
        > >> >-----Original Message-----
        > >> >I'm trying to set the height of a DIV through the[/color][/color]
        > style,[color=green][color=darkred]
        > >> by using the frame
        > >> >(orderscontrol ) height and subtracting a buffer space
        > >> used for some buttons
        > >> >but the function in the script tags doesn't even run.[/color][/color]
        > I[color=green][color=darkred]
        > >> get the error...
        > >> >
        > >> >############## ####
        > >> >#
        > >> >#
        > >> >
        > >> >Compilation Error
        > >> >Description: An error occurred during the compilation[/color][/color]
        > of[color=green][color=darkred]
        > >> a resource required
        > >> >to service this request. Please review the following
        > >> specific error details
        > >> >and modify your source code appropriately.
        > >> >
        > >> >Compiler Error Message: BC30451:
        > >> Name 'CustomHeighted Style' is not declared.
        > >> >
        > >> >Source Error:
        > >> >
        > >> >Line 39:
        > >> >Line 40: <DIV ID=divOverview
        > >> >Line 41: STYLE='<%=Custo mHeightedStyle( )%>'
        > >> >Line 42: align=center ms_positioning= "FlowLayout ">
        > >> >Line 43:
        > >> >
        > >> >#
        > >> >#
        > >> >############## #######
        > >> >
        > >> >
        > >> >
        > >> >and here's the HTML from the aspx page.
        > >> >
        > >> >
        > >> >
        > >> >############## ############### ##
        > >> >#
        > >> >#
        > >> >
        > >> ><body MS_POSITIONING= "GridLayout ">
        > >> >
        > >> ><SCRIPT LANGUAGE=javasc ript>
        > >> >
        > >> > function CustomHeightedS tyle()
        > >> > {
        > >> > var frmHeight = parent.ordersco ntrol.height
        > >> > var divHeight = frmHeight - 63
        > >> > var divStyle = "Z-INDEX: 102; " +
        > >> > "LEFT: 0px; " +
        > >> > "OVERFLOW: auto; " +
        > >> > "WIDTH: 100%; " +
        > >> > "POSITION: absolute; " +
        > >> > "TOP: 61px; HEIGHT: " +
        > >> > frmHeight.toStr ing() + "px"
        > >> > return divStyle
        > >> > }
        > >> >
        > >> ></SCRIPT>
        > >> >
        > >> ><form id=controls method=post runat="server">
        > >> >
        > >> ><DIV ID=divOverview
        > >> >STYLE='<%=Cust omHeightedStyle ()%>'
        > >> >align=center ms_positioning= "FlowLayout ">
        > >> >
        > >> >....some stuff...
        > >> >
        > >> ></DIV></FORM></BODY>
        > >> >
        > >> ></HTML>
        > >> >
        > >> >#
        > >> >#
        > >> >############## ############### ##
        > >> >
        > >> >I've tried usnig the "javascript :" prefix in the[/color][/color]
        > element[color=green][color=darkred]
        > >> tag, but then the
        > >> >error reads that 'javascript' is undefined.
        > >> >your help is appreciated, thanks
        > >> >Dan.
        > >> >
        > >> >
        > >> >.
        > >> >[/color]
        > >
        > >
        > >.
        > >[/color][/color]


        Comment

        • Kevin Spencer

          #5
          Re: javascript function not executing...

          If you set your div to runat server, you can control all attributes and
          styles in it programmaticall y. I believe that will give you all the control
          you need from the server side.

          --
          HTH,

          Kevin Spencer
          Microsoft MVP
          ..Net Developer
          All hotels in Benidorm. The best selection of Benidorm hotels with reviews and maps. Book in advance and save.

          Big things are made up of
          lots of little things.

          "(Liquid) Daniel Bass" <danielbassNOJU NK@MAILpostmast er.co.uk> wrote in
          message news:elib7jSTDH A.1664@TK2MSFTN GP11.phx.gbl...[color=blue]
          > This ain't working...
          > I'll scrap the javascript idea.
          > All I want to do is have a control, header section across the top of a[/color]
          page,[color=blue]
          > then a DIV beneath it so that the control doesn't scroll, but the DIV in[/color]
          the[color=blue]
          > rest of the body does. In other words, simulating frame behaviour with a[/color]
          top[color=blue]
          > banner/control static section and scrollable view beneath it with DIV[/color]
          tags.[color=blue]
          > The problem is DIV doesn't automattically take up the remaining space so[/color]
          the[color=blue]
          > idea behind my javascript was have something like
          >
          > the height of the DIV element = the height of the frame - the height of
          > my control panel
          >
          > is there another way around this? I goto the help section in the style[/color]
          sheet[color=blue]
          > say, and the help page does what i want to do, so i look at the source[/color]
          there[color=blue]
          > and it also uses DIV's, but I can't replicate the behaviour...
          >
          > thanks again.
          > Dan.
          >
          >
          > "Gary Varga" <MSNG@VargaLtd. freeserve.co.uk > wrote in message
          > news:0a0501c34d 27$17d76040$a60 1280a@phx.gbl.. .[color=green]
          > > Exactly!!!
          > >
          > > That is why I removed the <%= %> from around the CLIENT
          > > side function as it does not exist on the SERVER yet the
          > > <% %> surrounds SERVER code.
          > >
          > > (I used capitals as emphasis - not slight is intended).
          > >
          > > HTH,
          > > Gaz
          > >[color=darkred]
          > > >-----Original Message-----
          > > >doesn't it have to be client side since i want to get[/color]
          > > the containment[color=darkred]
          > > >frame's height, then apply that to a DIV attribute?
          > > >
          > > >"Gary Varga" <MSNG@VargaLtd. freeserve.co.uk > wrote in[/color]
          > > message[color=darkred]
          > > >news:0c2301c34 d1f$5963e630$a4 01280a@phx.gbl. ..
          > > >> Are you getting confused between client and server?
          > > >>
          > > >> Should it be:
          > > >>
          > > >> >
          > > >> >Source Error:
          > > >> >
          > > >> >Line 39:
          > > >> >Line 40: <DIV ID=divOverview
          > > >> >Line 41: STYLE=CustomHei ghtedStyle()
          > > >> >Line 42: align=center ms_positioning= "FlowLayout ">
          > > >> >Line 43:
          > > >> >
          > > >>
          > > >> HTH,
          > > >> Gaz
          > > >>
          > > >> >-----Original Message-----
          > > >> >I'm trying to set the height of a DIV through the[/color]
          > > style,[color=darkred]
          > > >> by using the frame
          > > >> >(orderscontrol ) height and subtracting a buffer space
          > > >> used for some buttons
          > > >> >but the function in the script tags doesn't even run.[/color]
          > > I[color=darkred]
          > > >> get the error...
          > > >> >
          > > >> >############## ####
          > > >> >#
          > > >> >#
          > > >> >
          > > >> >Compilation Error
          > > >> >Description: An error occurred during the compilation[/color]
          > > of[color=darkred]
          > > >> a resource required
          > > >> >to service this request. Please review the following
          > > >> specific error details
          > > >> >and modify your source code appropriately.
          > > >> >
          > > >> >Compiler Error Message: BC30451:
          > > >> Name 'CustomHeighted Style' is not declared.
          > > >> >
          > > >> >Source Error:
          > > >> >
          > > >> >Line 39:
          > > >> >Line 40: <DIV ID=divOverview
          > > >> >Line 41: STYLE='<%=Custo mHeightedStyle( )%>'
          > > >> >Line 42: align=center ms_positioning= "FlowLayout ">
          > > >> >Line 43:
          > > >> >
          > > >> >#
          > > >> >#
          > > >> >############## #######
          > > >> >
          > > >> >
          > > >> >
          > > >> >and here's the HTML from the aspx page.
          > > >> >
          > > >> >
          > > >> >
          > > >> >############## ############### ##
          > > >> >#
          > > >> >#
          > > >> >
          > > >> ><body MS_POSITIONING= "GridLayout ">
          > > >> >
          > > >> ><SCRIPT LANGUAGE=javasc ript>
          > > >> >
          > > >> > function CustomHeightedS tyle()
          > > >> > {
          > > >> > var frmHeight = parent.ordersco ntrol.height
          > > >> > var divHeight = frmHeight - 63
          > > >> > var divStyle = "Z-INDEX: 102; " +
          > > >> > "LEFT: 0px; " +
          > > >> > "OVERFLOW: auto; " +
          > > >> > "WIDTH: 100%; " +
          > > >> > "POSITION: absolute; " +
          > > >> > "TOP: 61px; HEIGHT: " +
          > > >> > frmHeight.toStr ing() + "px"
          > > >> > return divStyle
          > > >> > }
          > > >> >
          > > >> ></SCRIPT>
          > > >> >
          > > >> ><form id=controls method=post runat="server">
          > > >> >
          > > >> ><DIV ID=divOverview
          > > >> >STYLE='<%=Cust omHeightedStyle ()%>'
          > > >> >align=center ms_positioning= "FlowLayout ">
          > > >> >
          > > >> >....some stuff...
          > > >> >
          > > >> ></DIV></FORM></BODY>
          > > >> >
          > > >> ></HTML>
          > > >> >
          > > >> >#
          > > >> >#
          > > >> >############## ############### ##
          > > >> >
          > > >> >I've tried usnig the "javascript :" prefix in the[/color]
          > > element[color=darkred]
          > > >> tag, but then the
          > > >> >error reads that 'javascript' is undefined.
          > > >> >your help is appreciated, thanks
          > > >> >Dan.
          > > >> >
          > > >> >
          > > >> >.
          > > >> >
          > > >
          > > >
          > > >.
          > > >[/color][/color]
          >
          >[/color]


          Comment

          Working...