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

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
JavaScript Best Practices
LVL 13
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

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
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
Expert Spotlight: Joe Anderson (DatabaseMX)
LVL 13
Expert Spotlight: Joe Anderson (DatabaseMX)

We’ve posted a new Expert Spotlight!  Joe Anderson (DatabaseMX) has been on Experts Exchange since 2006. Learn more about this database architect, guitar aficionado, and Microsoft MVP.

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
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
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
OWASP Proactive Controls
LVL 13
OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

Please explain the workflow of a Certificate Signing Request

How does this request originate? What does it consist of? What kind of signing authority responds to this request?

And how does it relate to SSL?

And what about the latest update to the.NET Framework? 4.7.2?

Thanks.
1
Hello Experts,

One of our clients wants to bring there website in house and host it themselves.  Currently they do not have a server but will be having us set one up for them.  i know this is a broad scope question.  What would the general necessity's for hosting your own in house website, firewall, server, software, etc?

Thank you,

-GTS
0
Hi Experts

Could you pont a way to obtain the volume of accesses to a customer portals (Apache/ MSSQLServer) ?

Accordingly to:
 img002
The customer enter on some site's pages with it's credentials, choosing it's name on a combo, etc...

Is it possible to obtain the access volume by using the Apache default features, f.e. ?

Thanks in advance!
0
Web URL re-routing and questions about HTAccess

I have used HTAccess (originated with Apache) a few years ago on an MVC site to re-route the URL and am posting a few questions about how to do this today.

1) Is HTAccess still a viable option for web URL re-routing?
2) Is there a different way for a .NET MVC to get this capability?
3) Does HTAccess re-route WITHOUT needing a recompilation?
4) Is this considered "URL re-writing"?

Thanks
0
Dividing line between .NET Framework and ASP.NET?

When in comes to differentiating between .NET Framework and ASP.NET, I am a bit confused. Here are the list of enhancements to .NET Framework 4.7.1

For example, do the features below, which explicitly mention ASP.NET, only apply to "code behind" kinds of Web Forms?

The .NET Framework 4.7.1 includes improvements in several areas:

Accessibility improvements in narration, high contrast and focus control areas
.NET Framework support for .NET Standard 2.0 and compiler features
More secure SHA-2 support in ASP.NET and System.Messaging
Configuration builders
ASP.NET Execution step feature
ASP.NET HttpCookie parsing

Performance and reliability improvements

Thanks
0
I would like my Apache server to automatically connect all requests for a specific website using https:

I use MAMP Pro 5, running on Mac OS X 10.11.6  I have set up multiple websites, and for one specific domain I have successfully installed a SSL certificate that I purchased from namecheap.com
I can connect to the website securely if I type in the complete address, with https://

If I connect to the website without typing in https://  MAMP PRO's Apache server only serves up the pages without the secure connection

How can I have MAMP/Apache only connect visitors securely?
I've tried Allow http connections, but that doesn't redirect connections from http to https

MAMP Pro SSL settings for domain
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.