javascript - Load page then launch bootbox -


I am working on a function that works like this:

  1. On the link Click
  2. After a page load based on the link, a specific modal window will be clicked on
  3. proceed with the modal
  4. the end of the function

In my problem I am running that either the modal will not load, or it will load, but then the page will be closed immediately after the loading. I am working with this function

  $ (function () {$ ('# new-po'). Click (function () {window.location.href = $ ( This is) .attr ('href'); bootbox.dialog ({title: "Create new purchase order", message: '
"+" & lt; div class = "col -md-12 "& Gt; '+'
'+' & lt; / div & gt; '+' & lt; div class =" invoice number & lt; / label & gt; '+' & Lt; Input type = "text" class = "form-control" id = "inv_num" /> Col-md-6 "& gt; '+' & lt; label & gt; Vendor & lt; / label & gt; '+' & lt; input type = "text" class = "form-control" id = "vendor" /> gt; '+' '+' '+' & lt; div class = "col-md-12"> '+' & lt; div class = "form -group line "> gt; '+' & lt; Div class = "col-md-6" & gt; + '& Lt; Label & gt; Invoice number & lt; / Labels & gt; ' + '& Lt; Input type = "text" class = "form-control" id = "total" /> gt; + '& Lt; / Div> + '& Lt; Div class = "col-md-6" & gt; '+' & Lt; Label & gt; Seller & lt; / Label & gt; '+' & Lt; Select class = "form-control" id = "status" & gt; '+' & Lt; Option value = "" selected & gt; - Status- & lt; / Option & gt; '+' & Lt; Option value = "Open" & gt; Open & lt; / Option & gt; '+' & Lt; Option value = "off" & gt; Closed & lt; / Option & gt; '+' & Lt; Option "+ '& lt; / div & gt; + '& Lt; / div & gt; + '& Lt; / pricing & gt; zero & lt; / options & gt;' + '& Lt; / select & gt;' + '& Lt; / div & gt; Div & gt;' + '& lt; / form & gt;' + '& lt; / div & gt;' + '& lt; / div & gt; : {Success: {label: "create pio", classname: 'btn-success', callback: function () {}}}, oppose: function () {}});});});

This uses the bootbox extension, and so far I have not found any conflicts with it, so I'm going to continue to use it unless otherwise stated. $ (Document) .ready () , $ (window) .load () , $ (function () {}

The context of my page structure on every page also looks like this:

 < Code> & lt;! - Header contains html initial tag and main section - & gt; & lt;? Include "/ inc / header / adventall_header.php" ;? & gt; & lt ;! - html content Here - & gt; & lt;! - Includes script for footer pages and HTML completion tags - & gt; & lt;? Include "/ inc / header / successall_header.php" ;? & Gt;  

you window.location.href = $ (this) .attr ( 'Href') should be taken; This handler of handwriting dialog


Comments