jQuery html method behave strangely inside userScript

110
January 01, 2020, at 4:30 PM

I have the following line inside a userScript:

var dsad =  $('.modal-dialog strong:contains("Log file for job")').parents('.modal-dialog').find('pre').html().split('\n/g');

The userScript is running and when it gets to this line which uses jquery it throws an error: 'cannot read property 'split' of undefined'

I noticed this strange bevaior inside the console:

If you run the whole line inside console without assigning the result into a variable its working! but if your running the line with an assignment it returns undefined

Something with the assignment from the JQuery not working properly for me.

Thanks for the help

READ ALSO
Can you build static websites with React (Gatsby, Next) in the same way you would with jQuery, with animations and carousels?

Can you build static websites with React (Gatsby, Next) in the same way you would with jQuery, with animations and carousels?

I am new to a company in which websites are built with jQuery and plugins such as WoW and Owl CarouselHowever, I would like to try and work with React for the same purpose

91
progress on delayed data.submit() with blueimp file-upload

progress on delayed data.submit() with blueimp file-upload

I have a case where I have to save the form first - to get an id - which the uploaded files will be related to

83
jQuery function that dynamically load data AND also execute js?

jQuery function that dynamically load data AND also execute js?

For example we have two php pages (same domain):

85
How to modify event data on eventRender method while drag or resize event on Fullcalendar

How to modify event data on eventRender method while drag or resize event on Fullcalendar

I am trying to modify my event while drag or resize event but it's not workingactually I am trying if day end at 24:00 (but full calendar show it as 00:00) then I want to add more 2 hours for the next days

85