Not being able to access "document" object. #780
r1z4x
started this conversation in
4. General
Replies: 1 comment 3 replies
-
Did you try console.log(document), I tried on different components and it doesn't have a null value. Can you check that null is not the value returned by your querySelector call? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello there,
I am using more than one nested "x-data" method. But I cannot access the "document" object in the function in x-data. It has a "null" value.
Inside the head tag.
`<script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js" defer></script>
`<script src="{{ asset('js/focus-trap.js') }}"></script>
<script src="{{ asset('js/init-alpine.js') }}"></script>
Inside HTML "dom" elements.
`
<button @click="openModal('editProfileModal')" class="text-sm px-3 py-2 font-medium leading-5 text-white transition-colors duration-150 bg-blue-900 rounded-md focus:outline-none focus:shadow-outline-">
{{ __('auth.profile.edit_profile') }}
Beta Was this translation helpful? Give feedback.
All reactions