So i have written my bit of javascript which i think is correct feel free to tell me if not and then went to insert into the page that i so wish like this.
<script language="javascript" type ="text/javascript" >
var els = document.getElementsByTagName('*');
var PageUp;
var PageDown;
for (var i = 0, j = els.length; i < j; i++) {
var s = els[i].id
if (s != '') {
if (s.indexOf("ctl00$FunkeyContentPlaceHolder$SU0001DControl_PageUp") != -1) {
PageUp = els[i]
}
if (s.indexOf("ctl00$FunkeyContentPlaceHolder$SU0001DControl_PageDown") != -1) {
PageDown = els[i]
}
if (PageDown != null & !PageUp != null) {
PageDown.parentNode.insertBefore(PageUp, PageDown.nextSibling);
break;
}
}
}
</script>
but after running the website and it not working i checked the source code and it all points back to a MasterPage.master which looks a bit like this before i touch it.
<%@ Master Language="AVR" AutoEventWireup="true" CodeFile="MasterPage.master.vr" Inherits="Merret.Web.MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<!-- Enter handler -->
<%-- <script src="/scripts/jquery-1.3.2.min.js" ></script>--%>
<script src="../scripts/jquery-1.6.2.js"></script>
<script src="../scripts/external/jquery.bgiframe-2.1.2.js"></script>
<script src="../scripts/ui/jquery.ui.core.js"></script>
<script src="../scripts/ui/jquery.ui.widget.js"></script>
<script src="../scripts/ui/jquery.ui.mouse.js"></script>
<script src="../scripts/ui/jquery.ui.button.js"></script>
<script src="../scripts/ui/jquery.ui.draggable.js"></script>
<script src="../scripts/ui/jquery.ui.position.js"></script>
<script src="../scripts/ui/jquery.ui.resizable.js"></script>
<script src="../scripts/ui/jquery.ui.dialog.js"></script>
<script type="text/javascript">
}
$(function ShowPrintDialog() {
$("#myPrintsDiv").dialog("open");
$("#myPrintsDiv").dialog({
modal: true,
height: 550, width: 750,
autoOpen: false, resizable: true,
buttons: {
Ok: function() {
$(this).dialog("close");
}
}
});
});
$(function ShowJDialog() {
$("#dialog-message").dialog({
modal: true,
autoOpen: false, resizable:false,
buttons: {
Ok: function() {
$(this).dialog("close");
}
}
});
});
so i can see that the javascript here all start with function so i try and add that to my code and insert it in here like so:
<%@ Master Language="AVR" AutoEventWireup="true" CodeFile="MasterPage.master.vr" Inherits="Merret.Web.MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<!-- Enter handler -->
<%-- <script src="/scripts/jquery-1.3.2.min.js" ></script>--%>
<script src="../scripts/jquery-1.6.2.js"></script>
<script src="../scripts/external/jquery.bgiframe-2.1.2.js"></script>
<script src="../scripts/ui/jquery.ui.core.js"></script>
<script src="../scripts/ui/jquery.ui.widget.js"></script>
<script src="../scripts/ui/jquery.ui.mouse.js"></script>
<script src="../scripts/ui/jquery.ui.button.js"></script>
<script src="../scripts/ui/jquery.ui.draggable.js"></script>
<script src="../scripts/ui/jquery.ui.position.js"></script>
<script src="../scripts/ui/jquery.ui.resizable.js"></script>
<script src="../scripts/ui/jquery.ui.dialog.js"></script>
<script type="text/javascript">
function movebutton(s) {
var els = document.getElementsByTagName('*');
var PageUp;
var PageDown;
for (var i = 0, j = els.length; i < j; i++) {
var s = els[i].id
if (s != '') {
if (s.indexOf("ctl00$FunkeyContentPlaceHolder$SU0001DControl_PageUp") != -1) {
PageUp = els[i]
}
if (s.indexOf("ctl00$FunkeyContentPlaceHolder$SU0001DControl_PageDown") != -1) {
PageDown = els[i]
}
if (PageDown != null & !PageUp != null) {
PageDown.parentNode.insertBefore(PageUp, PageDown.nextSibling);
break;
}
}
}
}
$(function ShowPrintDialog() {
$("#myPrintsDiv").dialog("open");
$("#myPrintsDiv").dialog({
modal: true,
height: 550, width: 750,
autoOpen: false, resizable: true,
buttons: {
Ok: function() {
$(this).dialog("close");
}
}
});
});
$(function ShowJDialog() {
$("#dialog-message").dialog({
modal: true,
autoOpen: false, resizable:false,
buttons: {
Ok: function() {
$(this).dialog("close");
}
}
});
});
and now by right clicking and viewing source i can see my code but my page up still sits before my page down button.
am i putting my JS in the wrong place or is the JS wrong or both?
Thanks in Advance

New Topic/Question
Reply



MultiQuote




|