om-nextjs14.js

‘use client’; import { usePathname } from ‘next/navigation’; import { useEffect, useState } from ‘react’; export function RouteChangeListener() { const pathname = usePathname(); const [changes, setChanges] = useState(0); useEffect(() => { if (window.om5678_1234) { window.om5678_1234.reset(); } setChanges((prev) => prev +…Continue reading

om-nextjs.js

import { useEffect } from ‘react’; import { useRouter } from ‘next/router’; const OptinMonsterEmbed = () => { const router = useRouter() useEffect(() => { const handleRouteChange = (url, { shallow }) => { if (window.om5678_1234) { window.om5678_1234.reset(); } }…Continue reading

om-angularjs.js

// Using AngularJS. var myApp = angular.module(‘myApp’, []); myApp.run(function($rootScope) { $rootScope.$on(“$locationChangeStart”, function(event, next, current) { if (window.om5678_1234) { window.om5678_1234.reset(); } }); });Continue reading

om-reactv3.js

// Using React Router V3 import { browserHistory } from ‘react-router’; class App extends React.component { componentDidMount() { this.unlisten = browserHistory.listen( location => { if (window.om5678_1234) { window.om5678_1234.reset(); } }); } componentWillUnmount() { this.unlisten(); } render() { return ( ‘…Continue reading

om-reactv4.js

// Using React Router V4 import React from “react”; import { withRouter } from “react-router”; class App extends Component { componentDidMount() { this.unlisten = this.props.history.listen((location, action) => { if (window.om5678_1234) { window.om5678_1234.reset(); } }); } componentWillUnmount() { this.unlisten(); } render()…Continue reading

om-vue.js

// Using Vue Router. import Vue from ‘vue’; import Router from ‘vue-router’; Vue.use(Router); const router = new Router ({ // Your vue router settings. }); router.beforeEach((to, from, next) => { if (window.om5678_1234) { window.om5678_1234.reset(); } next(); }); export default router;Continue reading

om-vue.js

// Using Vue Router. import Vue from ‘vue’; import Router from ‘vue-router’; Vue.use(Router); const router = new Router ({ // Your vue router settings. }); router.beforeEach((to, from, next) => { if (window.om5678_1234) { window.om5678_1234.reset(); } next(); }); export default router;Continue reading

Dynamic Monsterlinks By Class Name

// Target by class name window.onload = function(){ const dynamicMonsterLinks = document.querySelectorAll(“a.myClass”); dynamicMonsterLinks.forEach(dynamicMonsterLinks => dynamicMonsterLinks.href = “MONSTERLINK_URL”); }Continue reading