Что бы объявить глобальную переменную нужно всего лишь удалить var перед переменной, и тогда она станет доступна по всей области видимости.
$(‘a[name=modal]’).click(function(e) {
//Cancel the link behavior
e.preventDefault();
//Get the A tag
var id = $(this).attr(‘href’);
id2 = $(this).attr(‘id’);
$(‘a[name=confirmdelete]’).click(function(e) {
alert(id2);
});
Как объявить глобальную переменную в javascript
Wow, awesome blog format! How lengthy have you been running a
blog for? you made running a blog look easy. The full look of your website
is great, let alone the content material!
You can see similar here ecommerce
Wow that was unusual. I just wrote an really long comment
but after I clicked submit my comment didn’t show up.
Grrrr… well I’m not writing all that over again. Regardless, just wanted to say superb blog!
I saw similar here: Sklep online
Piece of writing writing is also a excitement, if you know then you can write if
not it is difficult to write. I saw similar here: Dobry sklep
Howdy! Do you know if they make any plugins to help with SEO?
I’m trying to get my blog to rank for some targeted keywords but
I’m not seeing very good success. If you know of any please
share. Appreciate it! You can read similar article here:
Sklep online
Fantastic insights! Your perspective is very refreshing. For more details on this topic, visit: EXPLORE FURTHER. What do others think?