سلام . من این کد و نوشتم که هر بار که نام این فانکشن و صدا میزنم این کد html ک داخلش هست نمایش داده بشه ..
مشکلش و اگه میشه بهم بگید.
(function ($) { $.fn.myfunction = $(document).ready(function () { $("div").html("<div style='background-color:yellow;width:200px;height:300px'><p style='color:red'>Hello <b>Again</b></p></div>"); }); });
$(document).ready(function () { function myfunction() { $("div").html("<div style='background-color:yellow;width:200px;height:300px'><p style='color:red'>Hello <b>Again</b></p></div>"); } });
(function ($) { $.fn.test = function (alertText, alertStatus) { var succsess = $('<div class="su"> '+ alertText + alertStatus + '</div>') var error = $("<div class='errors'>" + alertText + alertStatus + "</div>") var warnings = $("<div class ='warnings'>" + alertText + alertStatus + "</div>") $("body").append(alertText); $("body").append(alertStatus); }; }(jQuery)); $(document).test("test");
اون مساله حل شد . ولی الان میخوام این مقادیر ر فراخوانی کنم . نمشه. حتی کلاسهام هم اجرا نمیشه..
function test(alertText, alertStatus) { var succsess = $('<div class="su"> '+ alertText + alertStatus + '</div>') var error = $("<div class='errors'>" + alertText + alertStatus + "</div>") var warnings = $("<div class ='warnings'>" + alertText + alertStatus + "</div>") $("body").append(alertText); $("body").append(alertStatus); }; }; $(function(){ test("test"); };
هیچ کاربری تا کنون از این پست تشکر نکرده است
با ما تماس بگیرید تا در این مسیر همراهتان باشیم :)