Web Development

74K

Solutions

49K

Contributors

Web development includes all aspects of presenting content on intranets and the Internet, including delivery development, protocols, languages and standards, server software, browser clients, databases and multimedia generation.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi, on https://magickitchen.com, there's a console error.

jquery.min.js:4 Uncaught TypeError: a.indexOf is not a function
    at r.fn.init.r.fn.load (jquery.min.js:4)
    at plugins.min.js:2
    at plugins.min.js:2

All I can find is that it could be a problem with the version of jquery (we are using https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js), or that there's some code using load, unload or error. I can't find any code doing that.

Can anyone tell me where I can fix this error? Thanks!
0
Become a CompTIA Certified Healthcare IT Tech
LVL 13
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

This is related to a recent question I posted, regarding the below code:
<div class="toggle-fieldView">
        <button type="button" data-value="Fund Now" class="">FUND NOW</button>
        <button type="button" data-value="Fund Later" class="active">FUND LATER</button>
</div>

Open in new window

This button element is loaded dynamically in the user flow after a specific view is displayed. How do I dynamically attach the "click" event to these two buttons?  I want to monitor when they are clicked but I want to remove the listener once the view changes? This is what I'm currently testing with but I need to be able to attach and then remove the listener? How do I do this?
    function _dtmCheckOAO4FundingMethod(){
        document.body.addEventListener('click', function(event) { //Need to fix and attach when needed
	        if((event.target.dataset)&&(event.target.type == "button")){ 
                if(event.target.dataset.value == "Fund Now"){
                    sessionStorage.setItem("_dtmFundType", "fund now");
                    sessionStorage.setItem("_dtmFundTypeDetail", ":Funding Method:fund within 30 days");
                }
                if(event.target.dataset.value == "Fund Later"){
                    sessionStorage.setItem("_dtmFundType", "fund later");
                     sessionStorage.setItem("_dtmFundTypeDetail", ":Funding Method:Credit Card");
                }
            }
        });
    };

Open in new window

I'm assuming that I 'd have to have two different assignments (one for each button) and manage separately?
Thanks!
0
How would I detect when this button
<button class="btn btn-mobile btn-page-next btn-next-residency" data-name="btn-page-next" type="button">CONTINUE<i class="icon-arrow-thin-right"></i><i class="spinner"></i></button>

Open in new window

is clicked? I tried :
    function _dtmCheckContinue(){
        document.body.addEventListener('click', function(event) { 
	      if((event.target.dataset)&&(event.target.type == "button")){ 
             if(event.target.dataset.value == "btn-grp-next"){
             console.log("<=====> CONTINUE BUTTON CLICKED");
             }
          }
      
        });
    }

Open in new window

I can never get into the if statement on line 4 so obviously there is an issue there.

Thanks!
0
How would I detect when the FUND LATER or FUND NOW button is selected or changed? I Know I have to use the class name of "active" for the selected button but not sure what else I need to do?
<div class="toggle-fieldView">
        <button type="button" data-value="Fund Now" class="">FUND NOW</button>
        <button type="button" data-value="Fund Later" class="active">FUND LATER</button>
</div>

Open in new window

This is a single page app so this content is added dynamically.
Thanks!
0
I have the following code but for some reason the check on line 15 doesn't work? I'm not sure why?
    var checkEmailConfirmCheckBox = document.getElementById('PRIMARY_BASIC_INFO_EMAIL-appRequest_primary_emailVerified'); 
      
    function _dtmCheckOAO4emailConfirmCheckbox(){
        checkEmailConfirmCheckBox = document.getElementById('PRIMARY_BASIC_INFO_EMAIL-appRequest_primary_emailVerified'); 
        if(checkEmailConfirmCheckBox != null){
            checkEmailConfirmCheckBox.addEventListener('change', trackEmailConfirmationCheckbox);
        } else {
            setTimeout( _dtmCheckOAO4emailConfirmCheckbox, 500);
        } 
    };
      
    function trackEmailConfirmationCheckbox(){
        console.log("==== IN FUNCTION ====");
        var emailCB = event.target.value;
        if(emailCB.checked){
         console.log("==== EMAIL CONF BOX CHECKED ====");
      
        }
        checkEmailConfirmCheckBox.removeEventListener('change', trackEmailConfirmationCheckbox);
    };

Open in new window


Thanks!
0
So I buld dynamic websites. As CMS I use something I have built by myself because I wanted to offer something very simple and easy to use to my client: they are small clent and they can't spend time to learn how to use Wordpress, OpenCart or other complex CMS. They just have to add, delete and modify some products data, or even just add some news to publish in the homepage.
So I have developed my own CMS. My problem is that I always work on it to improve it and everytime I change somewthing I have to manually upload changed files to the clients websites in order to always be sure I have the same code running in the various Control Panels.

As you guess, this becomes soon a crazy task, subject to errors and confusion. I would like to automate this process but I'm not sure how to do it.

Let me say that the develpment version of the code uses Git as Version control system. I also have to specify that between the various versions of the Control Panel, only one file is specific to that specific client, a configuration file in json format which my classes read to do the various tasks.

This config files holds specific settings and many times, as I improve the doce and some new features, the config file itself needs to be changed and I have some doubt this can be automated because here I need to preserve orginal specifi settings whil I add new sections with new settings and their default values.

So I think I could manually update only this file, but how can I make the …
1
Hi,

I am working on this page:
https://kroweb.dk/gfdev/gravsten_pk/gravsten/

At the top od my index.php file I have these lines:
<?php
session_start();
error_reporting(E_ALL);
ini_set('display_errors', 1);
?>

<?php
$link = mysqli_connect("mysql60.unoeuro.com", "kroweb_dk", "passsword", "kroweb_dk_db_gravsten");
$link->set_charset("utf8");
 
// Check connection
if($link === false){
    die("ERROR: Could not connect. " . mysqli_connect_error());
}

$id = $_GET[ 'id' ];
$sql = "SELECT id, Sogn, Stift, Provsti, navn, tlf, email, besked FROM gravsten WHERE id = $id"; 
$result = $link->query($sql);
$row = $result->fetch_object();
?>

Open in new window


But when entering the page I get this error message, which I can't figure out how to fix:

Notice: Undefined index: id in /var/www/kroweb.dk/public_html/gfdev/gravsten_pk/gravsten/index.php on line 16

Fatal error: Uncaught Error: Call to a member function fetch_object() on boolean in /var/www/kroweb.dk/public_html/gfdev/gravsten_pk/gravsten/index.php:19 Stack trace: #0 {main} thrown in /var/www/kroweb.dk/public_html/gfdev/gravsten_pk/gravsten/index.php on line 19.

Hope that somebody can lend me a hand with this :)
0
I have the below function:
    function _dtmIsAppDeclined(){
        var appDeclined = 0;
         //May have to move this into lower if statement 
        if((document.cookie.indexOf('startStandardOaoFlow=') !== -1)){
            s.events += (s.events == '') ? "event33" : ",event33";
        }
  
        var myCollection = document.getElementsByClassName('region-done-group');
        var i = myCollection.length;
        console.log("myCollection.length: " + i + " <---===> OAO4 myCollection holds: ",myCollection);
        while(i--) {
            if (myCollection[i].innerText.search('we cannot open the account') > -1) {
              console.log("5 ---===> OAO4 FOUND DECLINE TEXT");
            appDeclined = 1;
            s.events += (s.events == '') ? "event35" : ",event35";
            s.eVar23 ='decline';
            // Invoke marketing tags
            _dtmInsertStaticTags(sTags3);
            }
        }
        return appDeclined;
    };

Open in new window

The issue is that
var myCollection = document.getElementsByClassName('region-done-group');

Open in new window

Returns a length of 0 (see line 10 in the code) but still out puts the collection? I read that it is most likely because the getElementsByClassName returns a live collection. the length property of the object is 0 because at that point of time there is no element with that className in the DOM. ***Maybe 1 out 10 times when refreshing the page, the code works as expected*** How do I ensure that the classname is in the DOM before I do anything else? One caveat is this is a Single Page Application but it does have the ability for the user to refresh the page. This image shows the console log from line 10 above: Image showing console log for CollectionThanks!
0
I want any request that goes to mysite.com/index.html to be 301 redirected to mysite.com

Will the following mod_rewrite work in my htaccess file, is it comprehensive enough, and where would it need to be placed in the file?

RewriteCond %mysite.com/index.html HTTP [NC]
RewriteRule (.*)index.html$ /$1 [R=301,L]
0
I want to select a row from a table and present
that row in a asp.net web Form which is developed using the row columns?

I am developing a table which will consist of form data which will be presented
based on a given type.

Isaac
0
CompTIA Cloud+
LVL 13
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Hello,

Here's the background - I have a site that has a few functional areas where the source code is compiled and I don't have access to it. Occasionally, those pages generate some nasty errors, which I would like to clean up. A further catch is that the errors are specific to this program and not IIS/.NET, so there aren't error codes that I can lock in on.

I have been successful at identifying and replacing text using JQuery when the errors pop up - they are less ugly as a result! However, I'd like to use the same methodology to just redirect the page entirely on load.

So, in a nutshell, the process would be:
1. Page starts to load
2. JQuery (or something else  - I'm open) detects the error text
3. Page redirects to a new URL that has more information and is friendly

I know it's not great, but it's better than what I'm working with now. Here's what I'm doing with JQuery now:

jQuery(".ErrorHeader").text($(".ErrorHeader").text().replace("ERROR ERROR ERROR ERROR ERROR BAD INFORMATION", "Sorry, this page can not be loaded. Please hit the back button on your browser or try again."));

Thanks!
0
Hi everybody.
So I'm using a cde in .htaccess to remove php extension from the url:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} ^(.+)\.php$
RewriteRule (.*)\.php$ /$1 [R=301,L]

Open in new window

It works fine. But I have some dynamic url I want to make SEO compliant. For instance, I would like that
wines?wine=bordeaux

Open in new window

become
wines/bordeaux

Open in new window

So I looked around and I found this to put in my .htaccess
RewriteCond %{THE_REQUEST} \s/vinos\.php\?v=(\w+)\s [NC]
RewriteRule ^ /vinos/%1? [R=301,L]
RewriteRule ^vinos/(\w+)$ /vinos.php?v=$1 [L]

Open in new window

With this the url is rewritten as expected but in the page which is open php just doesn't work. And all css is lost...
Any idea about how can I remove the extension from the simple page and make dynamic urls seo friendly?
Thank you in advance for any suggestion :)
1
Looking to move audio player from development site.

Hi Guys, i was wondering if i could move the player thats here http://88.202.183.16/~iradiotest/ (when you hit play) to the main site https://iradio.ie (when you hit listen live)

I cant seem to find where the first player lives
0
Need a few ideas on how to code sample data to test my Kendo UI controls

I will be using Kendo UI, Angular and jQuery on my next project. So, I assume the client will have different Kendo UI controls to test. So, the best way to test them is to populate them with dummy data, since the back-end work may not be up to speed yet.

So, please provide one or more Javascript samples which I could use to store the sample data.

I guess a multi-dimensional Array is pretty common in Javascript, BUT, it would also help if you also have the Javascript wrapper which returns the sample set of data as JSON and XML.

Thanks
0
Where to place the <script> tag on the HTML page?

I know there are different places you can put this, depending on the behavior you want and also depending on the type of scripts you need to load.

So, what are the different places on theHTML page and what factors govern your decision? And are these script always Javascript?

Thanks
0
This is a follow-on question from https://www.experts-exchange.com/questions/29135199/In-jQuery-How-Do-You-Do-If-Test-On-Cookie.html?headerLink=workspace_answered_questions

I can create the cookie, write the message but now the message won't go away even if I manually delete the cookie, complete the order close the browser or clear the cache.  If I open a new tab and create a new order the message is still there.  The message is still there if I go to a different browser too.

There is no cache software on my test site.


Here is the code

<script>

jQuery('#cook').click(function(e) {
		e.preventDefault();
		document.cookie = "wantmembership=1; path=/";
              jQuery(this).css('background-color','green');
              jQuery(this).text("I Now Have A Membership!");
			});

jQuery(function($) {
  checkCookie();

  function getCookie(cname) 
  {
    var name = cname + "=";
    var ca = document.cookie.split(';');
    for(var i = 0; i < ca.length; i++) {
      var c = ca[i];
      while (c.charAt(0) === ' ') {
        c = c.substring(1);
      }
      if (c.indexOf(name) === 0) {
        return c.substring(name.length, c.length);
      }
    }
    return "";
  }

  function checkCookie() 
  {
    //document.write("Print this in the function");
    var username = getCookie("wantmembership");
    //document.write("Print this after the get");
    if (username= "wantmembership") {
      //document.write("Print this after the if test");
      

Open in new window

0
Need a quick refresher in jQuery. Video might be a great way, but also tutorials can be great.

Thanks
0
Upgrading Angular 4 to Angular 7

I will be coding with Angular 7 in the near future and need to upgrade a project I created with Angular 4. This will be part of my preparation.

What steps need to be taken?

Thanks.
0
I'm working on https://renalmeals.com. I used Google Chrome audit on it. One of the things it recommends is:
"For stylesheets, consider splitting up your styles into different files, organized by media query, and then adding a media attribute to each stylesheet link. When loading a page, the browser only blocks the first paint to retrieve the stylesheets that match the user's device. See Render-Blocking CSS to learn more. Build tools like critical can help you extract and inline critical CSS."

I'm pretty new at npm. No, I'm VERY new at NPM. I managed to install it using $ npm i -D critical@latest. Now I want to do this, below.  And I'm stumped. Can someone give me more specific instructions? Thanks!

Generate and inline critical-path CSS
Basic usage:

critical.generate({
  inline: true,
  base: 'test/',
  src: 'index.html',
  target: 'index-critical.html',
  width: 1300,
  height: 900,
});
0
Exploring SQL Server 2016: Fundamentals
LVL 13
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

We have a new website and one of the pages when opened in a browser is like a form, and the boxes are not lined up correctly and the page is dark.
Is there a program that I could open up the page and edit it, such as lining up the boxes and making the page brighter? We have Visual Studio 2015 and when I open the page up in design view, I can align the boxes but when I save it, it doesn't keep the changes.
Thanks.
0
I need to install Visual Studio Professional 2017 but want to be sure I get the settings correct. I have had bac luck in the past letting Visual Studio install my instance of SQL Server, and found it better to FIRST install SQL Server, THEN install Visual Studio.

So, my questions are where can I get the URL's for

Visual Studio Professional 2017
SQL Server 2016

I plan to install them and use them for free until I get license keys in the next few weeks.

Thanks
0

Content wider than screen

Clickable elements too close together

That's the mobile usability report for https://magickitchen.com/info/food-for-chronic-diseases.html.

This one, by contrast, is fine: https://www.magickitchen.com/info/protect-blood-vessels-and-kidneys-with-daily-exercise.html

Which leads me to believe the clickable elements issue isn't with the navigation or footer, which are identical.

The divs are the same as well, so I'm equally confused about the content width issue.

I've tried removing various elements (for instance, the testimonials section), but get the same response.
0
I have a web server in an AWS VPC.  
Only about 50 IP Addresses are open to see the page on this server.  I filter the IP addresses through Security Group, so if someone is not authorized, they cannot touch the machine at all..
 The issue I am running into is that all of the folks that cannot get in simply spin and timeout.  I would like them to get a message "You are not authorized to view this site".  How can I do that before I hit the page?
 I need to be able to check with the users IP address.

Thank you ion advance,
0
What .NET Technologies in a New MVC Application?

If you needed to architect a new  .NET MVC Application today, what would it consist of?

What version of .NET, MVC, might it be?
And what about Dependency Inversion?
What about Unit Testing?
What is your preferred Unit Test Framework?
What about AutoMapper?
How about a MOQ tool?

And what else am I forgetting to mention?

Thanks
0
Is KPM the String-searching algorithm needed to give user a City Name search field?

I need to code a CityName input field which allows the user to type a few characters, then show the user the closest matches, in a list.

Can you break this out into what is generally needed for this algorithm to work? Is KPM a choice?

As you can see, I just need to get my arms around this, conceptually.

 I would appreciate any guidance you can provide me.

Thanks
0

Web Development

74K

Solutions

49K

Contributors

Web development includes all aspects of presenting content on intranets and the Internet, including delivery development, protocols, languages and standards, server software, browser clients, databases and multimedia generation.