javascript - Modal error - Uncaught TypeError: undefined is not a function modal -


Im using the following code and I was deleted in JS ($ ("# deleteModal") There is an error: Modal ("Show"); ), Any ideas that might be wrong here? Using the MVC 5 Project

Error

UnkeyType Error Error: There is no undefined function

  & lt ;! - Modal - & gt; & Lt; Div class = "modal fade" id = "deleteModal" tabindex = "- 1" role = "dialog" aria-labelbedby = "deleteModalLabel" aria-hidden = "true" & gt; & Lt; Div class = "modal-dialog" & gt; & Lt; Div class = "modal-content" & gt; & Lt; Div class = "modal-header" & gt; & Lt; Button type = "button" class = "off" data-discarded = "model" & gt; & Lt; Span aria-hidden = "true" & gt; & Amp; time; & Lt; / Span & gt; & Lt; Span class = "sr -only" & gt; Close & lt; / Span & gt; & Lt; / Button & gt; & Lt; H4 class = "modal-title" id = "deleteModalLabel" & gt; Delete item & lt; / H4 & gt; & Lt; / Div & gt; & Lt; Div id = "deleteModalBody" class = "modal-body" & gt; & Lt; / Div & gt; & Lt; Div class = "modal-footer" & gt; & Lt; Button type = "button" class = "btn btn-default" data-dismissed = "model" & gt; Close & lt; / Button & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Script & gt; $ (Function () {$ ("# deleteModal"). Modal ("hide"); // Hides the modal pop-up required ("clickLinkLink") as long as the startup ("click", function () {$ .get ('@ Get.DeletePartial)', {id: $ (this) .prop ("id")}, function (data) {$ ("# deleteModalBody") .html (data); $ ("# DeleteModal"). Model ("show"); // shows the modal pop-up that is now our partial view)};});}); & Lt; / Script & gt;  

When I try as if trying to run it, it fails to beg for the script with the same error

  @section Scripts {& lt; Script src = "~ /Scripts/jquery-2.1.1.min.js"></script> & Lt; Script & gt; $ (Function () {$ ("# deleteModal"). Modal ("hide"); // Hides the modal pop-up required ("clickLinkLink") as long as the startup ("click", function () {$ .get ('@ Get.DeletePartial)', {id: $ (this) .prop ("id")}, function (data) {$ ("# deleteModalBody") .html (data); $ ("# DeleteModal"). Model ("Show"); // Now the modal pop-up shows that we have a partial view});});}); & Lt; / Script & gt; }  

It seems that you can create a model dialog through a third party Attempting the JQuery plugin, but you do phogate to make that plugin reference to the javascript file.

To confirm this, I wonder what line is the exception? Is this the line on the first line of your ready callback?

$ ("# deleteModal"). Model ("hide");

If so, please check your script reference. Just a & lt; Script & gt; Add tags to src for that file before adding your script block.

Update:

As you comment, the exception is not created on that line, so you can find out that if the function call fails, a debugger ( Such as Chrome Developer Tools). You can set debugger to prevent excuses. In Chrome Developer Tools, you can switch to the source tab and click on the last icon on the right-hand side of the right-hand side to enable this feature. Here's a terrific answer with snapshots:


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -